From 543b9e948e8d446f8c2e48f93066aae3666c8963 Mon Sep 17 00:00:00 2001 From: Michael Fatemi Date: Tue, 6 Jul 2021 22:53:22 -0400 Subject: [PATCH] fix some problems created when i was fixing other problems --- src/components/Notification.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/Notification.tsx b/src/components/Notification.tsx index 8ea8706..357b09d 100644 --- a/src/components/Notification.tsx +++ b/src/components/Notification.tsx @@ -8,21 +8,23 @@ export default function Notification({ }: { notification: INotification; }) { + const carpoolId = notification.carpool.id; + const acceptReq = useCallback(() => { - acceptRequest(notification.user.id); - }, [notification.user.id]); + acceptRequest(carpoolId, notification.user.id); + }, [carpoolId, notification.user.id]); const rejectReq = useCallback(() => { - denyRequest(notification.user.id); - }, [notification.user.id]); + denyRequest(carpoolId, notification.user.id); + }, [carpoolId, notification.user.id]); const acceptInv = useCallback(() => { - acceptInvite(notification.user.id); - }, [notification.user.id]); + acceptInvite(carpoolId, notification.user.id); + }, [carpoolId, notification.user.id]); const rejectInv = useCallback(() => { - denyInvite(notification.user.id); - }, [notification.user.id]); + denyInvite(carpoolId, notification.user.id); + }, [carpoolId, notification.user.id]); return (