diff --git a/frontend/src/components/organisms/ViewEvents.tsx b/frontend/src/components/organisms/ViewEvents.tsx
index 01a28440..fa9ea00b 100644
--- a/frontend/src/components/organisms/ViewEvents.tsx
+++ b/frontend/src/components/organisms/ViewEvents.tsx
@@ -63,6 +63,7 @@ const UpcomingEvents = () => {
endDate: event["endDate"],
role: "Supervisor",
hours: eventHours(event["startDate"], event["endDate"]),
+ status: event["status"],
imageURL: event["imageURL"],
};
}
@@ -79,6 +80,7 @@ const UpcomingEvents = () => {
role: "Volunteer",
hours: eventHours(event["startDate"], event["endDate"]),
imageURL: event["imageURL"],
+ status: event["status"],
};
}
) || [];
@@ -213,6 +215,7 @@ const PastEvents = () => {
endDate: event["endDate"],
role: "Supervisor",
hours: eventHours(event["endDate"], event["startDate"]),
+ status: event["status"],
});
});
@@ -225,6 +228,7 @@ const PastEvents = () => {
endDate: event["endDate"],
role: "Volunteer",
hours: eventHours(event["endDate"], event["startDate"]),
+ status: event["status"],
});
});
@@ -311,6 +315,19 @@ const PastEvents = () => {
renderHeader: (params) => (
{params.colDef.headerName}
),
+ renderCell: (params) => (
+
+ {params.row.name}
+ {params.row.status == "CANCELED" && (
+
+ )}
+
+ ),
},
{
field: "startDate",
@@ -373,6 +390,19 @@ const PastEvents = () => {
renderHeader: (params) => (
{params.colDef.headerName}
),
+ renderCell: (params) => (
+
+ {params.row.name}
+ {params.row.status == "CANCELED" && (
+
+ )}
+
+ ),
},
{
field: "startDate",
@@ -519,6 +549,7 @@ const ViewEvents = () => {
const [isEventCreated, setIsEventCreated] = useState(false);
const [isEventEdited, setIsEventEdited] = useState(false);
+ const [isEventCanceled, setIsEventCanceled] = useState(false);
useEffect(() => {
const isEventCreated = localStorage.getItem("eventCreated");
@@ -530,6 +561,10 @@ const ViewEvents = () => {
setIsEventEdited(true);
localStorage.removeItem("eventEdited");
}
+ if (localStorage.getItem("eventCanceled")) {
+ setIsEventCanceled(true);
+ localStorage.removeItem("eventCanceled");
+ }
}, []);
return (
@@ -551,6 +586,16 @@ const ViewEvents = () => {
>
Your event has been successfully updated!
+
+ {/* Event canceled success notification */}
+
setIsEventCanceled(false)}
+ >
+ Your event has been successfully canceled!
+
+
My Events}
diff --git a/frontend/src/pages/events/[eventid]/edit.tsx b/frontend/src/pages/events/[eventid]/edit.tsx
index 6b469c8c..901ddb17 100644
--- a/frontend/src/pages/events/[eventid]/edit.tsx
+++ b/frontend/src/pages/events/[eventid]/edit.tsx
@@ -20,6 +20,7 @@ type eventData = {
startTime: Date;
endTime: Date;
mode: string;
+ status: string;
};
/** An EditEvent page */
@@ -48,6 +49,7 @@ const EditEvent = () => {
startTime: data?.startDate,
endTime: data?.endDate,
mode: data?.mode,
+ status: data?.status,
};
/** Loading screen */
diff --git a/frontend/src/pages/profile.tsx b/frontend/src/pages/profile.tsx
index a6635312..ed9fabe2 100644
--- a/frontend/src/pages/profile.tsx
+++ b/frontend/src/pages/profile.tsx
@@ -20,8 +20,8 @@ const Profile = () => {
const { data, isLoading, isError } = useQuery({
queryKey: ["profile", user?.email],
queryFn: async () => {
- const { data } = await api.get(`/users/search/?email=${user?.email}`);
- return data["data"][0];
+ const { data } = await api.get(`/users?email=${user?.email}`);
+ return data["data"]["result"][0];
},
});
@@ -102,6 +102,7 @@ const Profile = () => {
diff --git a/frontend/src/utils/helpers.ts b/frontend/src/utils/helpers.ts
index 82056a2f..879103c1 100644
--- a/frontend/src/utils/helpers.ts
+++ b/frontend/src/utils/helpers.ts
@@ -17,8 +17,8 @@ import {
* @returns the userid
*/
export const fetchUserIdFromDatabase = async (email: string) => {
- const { data } = await api.get(`/users/search/?email=${email}`);
- return data["data"][0]["id"];
+ const { data } = await api.get(`/users?email=${email}`);
+ return data["data"]["result"][0]["id"];
};
/**
diff --git a/frontend/src/utils/types.ts b/frontend/src/utils/types.ts
index 49a33915..ce00952e 100644
--- a/frontend/src/utils/types.ts
+++ b/frontend/src/utils/types.ts
@@ -11,6 +11,7 @@ export type ViewEventsEvent = {
ownerId?: string;
description?: string;
capacity?: number;
+ status?: EventStatus;
imageURL?: string;
};