|
|
@ -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, |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
@ -73,7 +70,7 @@ 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
|
|
|
|