gfa-cc-after / Pet-Clinic-GilmoreDevs

Pet clinic project made by group 2
https://frontend-production-e146.up.railway.app/
GNU General Public License v3.0
2 stars 0 forks source link

chore: user profile can be deleted #75

Closed carlos-ponton closed 2 months ago

carlos-ponton commented 2 months ago

SCRUM-70: Create the delete endpoint

Backend:

FrontEnd:

If for some reason it's not possible to delete the profile, the "Unable to delete profile" message will be display on the page.

const handleDeletion = async (e: { preventDefault: () => void }) => {
    e.preventDefault();
    try {
      await deleteProfile();
      logout();
      navigate("/");
    } catch (_error) {
      setErrMessage("Unable to delete profile");
    }
  };