|
@ -2,16 +2,15 @@ import moment from "moment"; |
|
|
import React from "react"; |
|
|
import React from "react"; |
|
|
import sendFormAnswer from "../../api/Ingestion/sendFormAnswer"; |
|
|
import sendFormAnswer from "../../api/Ingestion/sendFormAnswer"; |
|
|
|
|
|
|
|
|
const AssembleIngestionObject = ({ |
|
|
|
|
|
images, |
|
|
|
|
|
description, |
|
|
|
|
|
|
|
|
const AssembleIngestionObject = ( |
|
|
|
|
|
{ images, description }, |
|
|
situation, |
|
|
situation, |
|
|
code, |
|
|
code, |
|
|
location, |
|
|
location, |
|
|
date, |
|
|
date, |
|
|
time, |
|
|
time, |
|
|
address, |
|
|
|
|
|
}) => { |
|
|
|
|
|
|
|
|
address |
|
|
|
|
|
) => { |
|
|
const ingestionObject = { |
|
|
const ingestionObject = { |
|
|
responseData: { |
|
|
responseData: { |
|
|
array_to_json: [ |
|
|
array_to_json: [ |
|
@ -26,9 +25,7 @@ const AssembleIngestionObject = ({ |
|
|
fieldsanswerseventaddress: address, |
|
|
fieldsanswerseventaddress: address, |
|
|
fieldsanswerseventdate: moment(date).format("DD-MM-YYYY"), |
|
|
fieldsanswerseventdate: moment(date).format("DD-MM-YYYY"), |
|
|
fieldsanswerseventtime: moment(time).format("HH:mm"), |
|
|
fieldsanswerseventtime: moment(time).format("HH:mm"), |
|
|
fieldsanswercomment: description |
|
|
|
|
|
? description |
|
|
|
|
|
: "descrição do evento", |
|
|
|
|
|
|
|
|
fieldsanswerscomment: description, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
@ -65,7 +62,7 @@ const AssembleIngestionPluviometer = ({ |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const AssembleIngestionPluvRegistration = ({date, time, user}) => { |
|
|
|
|
|
|
|
|
const AssembleIngestionPluvRegistration = ({ date, time, user }) => { |
|
|
const pluvResgistrationObject = { |
|
|
const pluvResgistrationObject = { |
|
|
responseData: { |
|
|
responseData: { |
|
|
array_to_json: [ |
|
|
array_to_json: [ |
|
@ -73,13 +70,13 @@ const AssembleIngestionPluvRegistration = ({date, time, user}) => { |
|
|
formcode: "PLUVIOMETER_REGISTRATION", |
|
|
formcode: "PLUVIOMETER_REGISTRATION", |
|
|
formsanswersuserinformer: "admin@wpd.com", //user
|
|
|
formsanswersuserinformer: "admin@wpd.com", //user
|
|
|
fieldsanswerslongitude: -46.5637, //location["longitude"],
|
|
|
fieldsanswerslongitude: -46.5637, //location["longitude"],
|
|
|
fieldsanswerslatitude: -23.6230,//location["latitude"],
|
|
|
|
|
|
|
|
|
fieldsanswerslatitude: -23.623, //location["latitude"],
|
|
|
fields: [ |
|
|
fields: [ |
|
|
{ |
|
|
{ |
|
|
fieldsanswerseventaddress: "Rua Rio de Janeiros, 81",//address
|
|
|
|
|
|
|
|
|
fieldsanswerseventaddress: "Rua Rio de Janeiros, 81", //address
|
|
|
fieldsanswerseventdate: moment(date).format("DD-MM-YYYY"), |
|
|
fieldsanswerseventdate: moment(date).format("DD-MM-YYYY"), |
|
|
fieldsanswerseventtime: moment(time).format("HH:mm"), |
|
|
fieldsanswerseventtime: moment(time).format("HH:mm"), |
|
|
fieldsanswersinstitutename: "E. E. Vagner", |
|
|
|
|
|
|
|
|
fieldsanswersinstitutename: "E. E. Vagner", |
|
|
fieldsanswerrinstitutetype: "Escola", |
|
|
fieldsanswerrinstitutetype: "Escola", |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|