From b8eb285abf18dd3909754e508c3ed953874ef60f Mon Sep 17 00:00:00 2001 From: julia-weppler-1 <156942916+julia-weppler-1@users.noreply.github.com> Date: Mon, 17 Aug 2026 14:00:53 -0400 Subject: [PATCH] Suggest error handling for user account deletion Added a comment recommending error handling for DELETE request. --- frontend/src/pages/ProfilePage.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/pages/ProfilePage.jsx b/frontend/src/pages/ProfilePage.jsx index de51df5..44b299d 100644 --- a/frontend/src/pages/ProfilePage.jsx +++ b/frontend/src/pages/ProfilePage.jsx @@ -17,6 +17,7 @@ function ProfilePage({ currentUser, onUserChange }) { await fetch(`/api/users/${currentUser._id}`, { method: "DELETE" }); // clear the app-wide user, then back to the homepage — the account is gone, // so a login form is the one page they can't use + // I would recommend error handling here so if the DELETE fails, the user isn't logged out and is instead shown a message. onUserChange(null); navigate("/"); }