From df677c559ea3778ce5540e595b793d2434869964 Mon Sep 17 00:00:00 2001 From: hookor Date: Sun, 19 May 2024 22:47:50 +0900 Subject: [PATCH] Feat: delete search/notification cache history on account deletion --- src/hooks/MyPage/useHandleAuth.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hooks/MyPage/useHandleAuth.ts b/src/hooks/MyPage/useHandleAuth.ts index 8ceae6da..838355e9 100644 --- a/src/hooks/MyPage/useHandleAuth.ts +++ b/src/hooks/MyPage/useHandleAuth.ts @@ -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); }; @@ -38,6 +46,7 @@ export const useHandleAuth = () => { } if (isModal) { const deleteAccount = async () => { + await handleDeleteHistory(); await deleteUserAccount(); await deleteStorage(userRoute); await deleteFolder(postRoute);