diff --git a/src/pages/notifications/notifications.js b/src/pages/notifications/notifications.js index 01f7490ef9e80db6f1f46d1ff164a2a1921fd463..1650c1a6f4c8fff562dfcfcce4be66c5b8eb2036 100644 --- a/src/pages/notifications/notifications.js +++ b/src/pages/notifications/notifications.js @@ -33,20 +33,8 @@ const NotificationsPage = () => { throw new Error("Failed to fetch notifications"); } const data = await response.json(); - // const data = [ - // { - // _id: "1", - // title: "Booked another parking space", - // description: "booked at this area", - // date: "2023-04-20T07:59:52.289Z", - // }, - // { - // _id: "2", - // title: "Booked space", - // description: "booked this area", - // date: "2023-04-20T07:59:52.289Z", - // }, - // ]; + + setNotifications(data); setLoading(false); } catch (error) { @@ -57,7 +45,7 @@ const NotificationsPage = () => { const deleteNotification = async (notificationId) => { try { - const response = await fetch(`/api/notifications/delete/${notificationId}`, { + const response = await fetch(`${baseUrl}/notification/delete/${notificationId}`, { method: "DELETE", headers: { Authorization: `Bearer ${localStorage.getItem("token")}`, @@ -90,7 +78,7 @@ const NotificationsPage = () => { const clearAllNotifications = async () => { // make a request to the notifications microservice to clear all notifications try { - const response = await fetch(`/api/notifications/delete/all/`, { + const response = await fetch(`${baseUrl}/notification/delete/all/`, { method: "DELETE", headers: { Authorization: `Bearer ${localStorage.getItem("token")}`,