diff --git a/src/queries/resume/delete/useDeleteResume.ts b/src/queries/resume/delete/useDeleteResume.ts index c48d5f31..954a0e2c 100644 --- a/src/queries/resume/delete/useDeleteResume.ts +++ b/src/queries/resume/delete/useDeleteResume.ts @@ -19,6 +19,9 @@ export const useDeleteResume = () => { await queryClient.cancelQueries({ queryKey: TARGET_QUERY_KEY }); const previousResumes = queryClient.getQueryData(TARGET_QUERY_KEY); queryClient.setQueryData(TARGET_QUERY_KEY, (old: MyResume[]) => { + if (!old) { + return; + } return old.filter((resume) => resume.id !== parseInt(resumeId)); }); return { previousResumes };