analuizaff
2 years ago
16 changed files with 242 additions and 72 deletions
-
68src/App.js
-
7src/app.json
-
18src/app/api/Ingestion/sendFormAnswer.js
-
BINsrc/app/assets/appLogo.png
-
23src/app/components/forms/AssembleIngestionObject.js
-
2src/app/screens/AccountScreen.js
-
2src/app/screens/MapFeedScreen.js
-
2src/app/screens/MapFormScreen.js
-
2src/app/screens/PluviometerRegisterScreen.js
-
10src/app/screens/PluviometerSharingDataScreen.js
-
35src/app/screens/RainSharingDataScreen.js
-
17src/app/screens/RiverFloodSharingDataScreen.js
-
14src/app/screens/SharingDataScreen.js
-
17src/app/screens/SharingFloodZonesScreen.js
-
39src/app/utility/cache.js
-
18src/eas.json
@ -1,15 +1,25 @@ |
|||||
import appIngestion from "./appIngestion"; |
import appIngestion from "./appIngestion"; |
||||
|
|
||||
|
import cache from "../../utility/cache"; |
||||
const endpoint = "/api/wpdAppIngestion?"; |
const endpoint = "/api/wpdAppIngestion?"; |
||||
|
|
||||
async function sendFormAnswer(ingestionObject) { |
|
||||
// console.log(JSON.stringify(ingestionObject));
|
|
||||
|
|
||||
|
async function sendFormAnswer(ingestionObject, connection, formName) { |
||||
|
if (connection) { |
||||
const response = await appIngestion.post( |
const response = await appIngestion.post( |
||||
endpoint, |
endpoint, |
||||
JSON.stringify(ingestionObject) |
JSON.stringify(ingestionObject) |
||||
); |
); |
||||
return response; |
return response; |
||||
|
} else { |
||||
|
const formArray = []; |
||||
|
const teste = await cache.get("sendforms"); |
||||
|
if (teste) { |
||||
|
var object = JSON.parse(teste); |
||||
|
object.forEach((element) => formArray.push(element)); |
||||
|
} |
||||
|
formArray.push(ingestionObject); |
||||
|
cache.store("sendforms", formArray); |
||||
|
return { ok: true }; |
||||
|
} |
||||
} |
} |
||||
|
|
||||
export default sendFormAnswer; |
export default sendFormAnswer; |
After Width: 400 | Height: 400 | Size: 72 KiB |
@ -0,0 +1,18 @@ |
|||||
|
{ |
||||
|
"cli": { |
||||
|
"version": ">= 0.40.0" |
||||
|
}, |
||||
|
"build": { |
||||
|
"development": { |
||||
|
"developmentClient": true, |
||||
|
"distribution": "internal" |
||||
|
}, |
||||
|
"preview": { |
||||
|
"distribution": "internal" |
||||
|
}, |
||||
|
"production": {} |
||||
|
}, |
||||
|
"submit": { |
||||
|
"production": {} |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue