From 6340611c4b95548edc023c18c77d929bf01ec144 Mon Sep 17 00:00:00 2001 From: NityaNagaSai Date: Sun, 24 Mar 2024 12:53:07 -0400 Subject: [PATCH] Changed Some Interfaces to make delete work --- src/pages/Participants/ParticipantDelete.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/Participants/ParticipantDelete.tsx b/src/pages/Participants/ParticipantDelete.tsx index 5a7de7d..2fd1d60 100644 --- a/src/pages/Participants/ParticipantDelete.tsx +++ b/src/pages/Participants/ParticipantDelete.tsx @@ -22,7 +22,7 @@ const DeleteParticipant: React.FC = ({ participantData, onCl // Delete user const deleteHandler = () => - deleteParticipant({ url: `/participants/${participantData.id}`, method: HttpMethod.DELETE }); + deleteParticipant({ url: /participants/${participantData.id}, method: HttpMethod.DELETE }); // Show error if any useEffect(() => { @@ -36,12 +36,12 @@ const DeleteParticipant: React.FC = ({ participantData, onCl dispatch( alertActions.showAlert({ variant: "success", - message: `User ${participantData.name} deleted successfully!`, + message: User ${participantData.user.name} deleted successfully!, }) ); onClose(); } - }, [deletedParticipant?.status, dispatch, onClose, participantData.name]); + }, [deletedParticipant?.status, dispatch, onClose, participantData.user.name]); const closeHandler = () => { setShow(false); @@ -55,7 +55,7 @@ const DeleteParticipant: React.FC = ({ participantData, onCl

- Are you sure you want to delete participant {participantData.name}? + Are you sure you want to delete participant {participantData.user.name}?

@@ -70,4 +70,4 @@ const DeleteParticipant: React.FC = ({ participantData, onCl ); }; -export default DeleteParticipant; +export default DeleteParticipant; \ No newline at end of file