Skip to content

Commit

Permalink
Feat: delete search/notification cache history on account deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
hookor authored and cuconveniencestore committed May 22, 2024
1 parent d9e911b commit df677c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/hooks/MyPage/useHandleAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ export const useHandleAuth = () => {
goToStart();
};

const handleDeleteHistory = async () => {
await useDeleteCacheData(`search`, [`/user-${userId}`]);
await useDeleteCacheData(`notification`, [
`/user-${userId}`,
`/unread-${userId}`
]);
};

const handleConfirmBtn = () => {
setIsConfirm(!isConfirm);
};
Expand All @@ -38,6 +46,7 @@ export const useHandleAuth = () => {
}
if (isModal) {
const deleteAccount = async () => {
await handleDeleteHistory();
await deleteUserAccount();
await deleteStorage(userRoute);
await deleteFolder(postRoute);
Expand Down

0 comments on commit df677c5

Please sign in to comment.