Skip to content

Commit

Permalink
Changed Some Interfaces to make delete work
Browse files Browse the repository at this point in the history
  • Loading branch information
NityaNagaSai committed Mar 24, 2024
1 parent 9f65ed7 commit 6340611
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pages/Participants/ParticipantDelete.tsx
Expand Up @@ -22,7 +22,7 @@ const DeleteParticipant: React.FC<IDeleteParticipant> = ({ 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(() => {
Expand All @@ -36,12 +36,12 @@ const DeleteParticipant: React.FC<IDeleteParticipant> = ({ 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);
Expand All @@ -55,7 +55,7 @@ const DeleteParticipant: React.FC<IDeleteParticipant> = ({ participantData, onCl
</Modal.Header>
<Modal.Body>
<p>
Are you sure you want to delete participant <b>{participantData.name}?</b>
Are you sure you want to delete participant <b>{participantData.user.name}?</b>
</p>
</Modal.Body>
<Modal.Footer>
Expand All @@ -70,4 +70,4 @@ const DeleteParticipant: React.FC<IDeleteParticipant> = ({ participantData, onCl
);
};

export default DeleteParticipant;
export default DeleteParticipant;

0 comments on commit 6340611

Please sign in to comment.