refactor: streamline async logic and notification handling across various settings and integration components

This commit is contained in:
Victor Santos
2025-11-03 15:11:10 -03:00
parent 3aeee8d552
commit c005f8a0fe
33 changed files with 709 additions and 1061 deletions
@@ -15,23 +15,15 @@ export const DeleteAccountSection = () => {
const { mutateAsync: deleteUserMutateAsync, isPending } = useDeleteMe();
const handleDeleteAccountSubmit = async () => {
try {
await deleteUserMutateAsync();
await deleteUserMutateAsync();
createNotification({
text: "Successfully deleted account",
type: "success"
});
createNotification({
text: "Successfully deleted account",
type: "success"
});
navigate({ to: "/login" });
handlePopUpClose("deleteAccount");
} catch (err) {
console.error(err);
createNotification({
text: "Failed to delete account",
type: "error"
});
}
navigate({ to: "/login" });
handlePopUpClose("deleteAccount");
};
return (