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