Skip to content

Commit

Permalink
fix: user should not be able to delete themselves (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudambro authored Apr 1, 2022
1 parent 38c2a2a commit 1ba98da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dashboard/src/scenes/user/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ const View = () => {
</Col>
</Row>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
<ButtonCustom title={'Supprimer'} type="button" style={{ marginRight: 10 }} color="danger" onClick={deleteData} width={200} />
{id !== user._id && (
<ButtonCustom title={'Supprimer'} type="button" style={{ marginRight: 10 }} color="danger" onClick={deleteData} width={200} />
)}
<ButtonCustom title={'Mettre à jour'} loading={isSubmitting} onClick={handleSubmit} width={200} />
</div>
</React.Fragment>
Expand Down

0 comments on commit 1ba98da

Please sign in to comment.