From 708bcdf50ce32ffcdc82e55ed13045aa70e2c0cc Mon Sep 17 00:00:00 2001 From: JHM69 Date: Fri, 10 May 2024 21:10:18 -0700 Subject: [PATCH] Add Waste Entry --- .../dncc_eco_sync/service/UploadService.java | 2 +- react-app/components/WasteEntryForm/index.js | 47 +++++++++++++++++++ react-app/pages/vehicle-entry/[stsId].js | 26 +++++----- 3 files changed, 63 insertions(+), 12 deletions(-) diff --git a/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/service/UploadService.java b/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/service/UploadService.java index 9ff58d5..edee313 100644 --- a/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/service/UploadService.java +++ b/android-app/app/src/main/java/com/quantum_guys/dncc_eco_sync/service/UploadService.java @@ -279,7 +279,7 @@ private void uploadPost(int notification_id, String currentUser_id, String descr postMapFinal.put(getSaltString(), postMap); - if(posttype.equals("issue")){ + if(posttype != null && posttype.equals("issue")){ postMapFinal.put("posttype", "issue"); postMap.put("isAnonymous", isAnonymous); postMap.put("states", "Pending"); diff --git a/react-app/components/WasteEntryForm/index.js b/react-app/components/WasteEntryForm/index.js index 6f0da51..c2937e5 100644 --- a/react-app/components/WasteEntryForm/index.js +++ b/react-app/components/WasteEntryForm/index.js @@ -21,6 +21,9 @@ const WasteEntryForm = ({ type, defaultValues, onFormSubmit, ...props }) => { ? new Date(defaultValues.timeOfArrival).toISOString().slice(0, 16) : '' // Converts to "YYYY-MM-DDTHH:MM" format setValue('timeOfArrival', formattedTimeOfArrival) + setValue('contractorId', defaultValues.contractorId) + setValue('wasteType', defaultValues.wasteType) + setValue('vehicleType', defaultValues.vehicleType) } }, [defaultValues, setValue]) @@ -52,6 +55,50 @@ const WasteEntryForm = ({ type, defaultValues, onFormSubmit, ...props }) => { })} /> + + + + + + + + {/* -
-
+
+ +

- Vehicle Entries{' '} + Waste Entries

- {stsId && } + {stsId && }
{loading ? ( - + ) : ( - + )}
-
+ +

- Waste Entries + Vehicle Entries{' '}

- {stsId && } + {stsId && }
{loading ? ( - + ) : ( - + )}
+ +