Well you haven’t really given any information, but given that you’re using an API to hold the source of truth of information that exists, the deletion of the user needs to happen there. The front end code is all UI, so you’ll probably want to give some feedback when it’s complete or output any errors. Probably distinguish an admin from a non-admin so you only show the delete-user UI to an admin (though that should still be verified on the api side before any actions are taken). But ultimately, to delete the user you just need to call the api endpoint that handles that action.
↧