From beb2f5ebf997ccc6b5b0aa56d7436d2e9ea0bcef Mon Sep 17 00:00:00 2001 From: swastik Date: Fri, 19 Apr 2024 01:59:58 +0530 Subject: [PATCH] minor UI fixes --- .../additionalInfo-form.tsx | 26 +++++++++---------- .../createEvent/createEvent-form.tsx | 19 +++++++------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/app/homepage2/createEvent/additionalInformation/additionalInfo-form.tsx b/app/homepage2/createEvent/additionalInformation/additionalInfo-form.tsx index 43ef28f..47568ef 100644 --- a/app/homepage2/createEvent/additionalInformation/additionalInfo-form.tsx +++ b/app/homepage2/createEvent/additionalInformation/additionalInfo-form.tsx @@ -110,10 +110,13 @@ const AdditionalForm = (props: Props) => { }); } else { // If the sponsors field doesn't exist, set it - await updateDoc(eventRef, { - sponsors: sponsors, - locationOfEvent: docSnap.data().locationOfEvent + ", " + landmark, - }); + + //just a waste of space and time , the code is not ever going to reach here + + // await updateDoc(eventRef, { + // sponsors: sponsors, + // locationOfEvent: docSnap?.data()?.locationOfEvent + ", " + landmark, + // }); } console.log("Update successful"); @@ -121,6 +124,10 @@ const AdditionalForm = (props: Props) => { title: "Event Updated", description: "Event has been updated successfully.", }); + + router.push("/homepage2"); + + } catch (error) { console.error("Error updating document: ", error); } @@ -140,15 +147,6 @@ const AdditionalForm = (props: Props) => { // locationOfEvent: data.locationOfEvent + ", " + landmark; updateEvent(eventId, data); - - toast({ - title: "You submitted the following values:", - description: ( -
-          {JSON.stringify(data, null, 2)}
-        
- ), - }) } @@ -173,7 +171,7 @@ const AdditionalForm = (props: Props) => { onChange={(e) => setLandmark(e.target.value)} /> - {/*
This is the location of the event.
*/} +
Optional*
)} diff --git a/app/homepage2/createEvent/createEvent-form.tsx b/app/homepage2/createEvent/createEvent-form.tsx index ef2cd37..ce9573d 100644 --- a/app/homepage2/createEvent/createEvent-form.tsx +++ b/app/homepage2/createEvent/createEvent-form.tsx @@ -564,14 +564,15 @@ const CreatEventPage = () => { createEventPost(data); - toast({ - title: "You submitted the following values:", - description: ( -
-              {JSON.stringify(data, null, 2)}
-            
- ), - }) + // toast({ + // title: "You submitted the following values:", + // description: ( + //
+        //       {JSON.stringify(data, null, 2)}
+        //     
+ // ), + // }) + } @@ -950,7 +951,7 @@ const CreatEventPage = () => { )} /> */} - +