From 7d0dba966968d9a5f6c15fee769ba03e5e9b633a Mon Sep 17 00:00:00 2001 From: Keane Chan Date: Sat, 22 Oct 2022 00:09:27 +0800 Subject: [PATCH] [resumes][fix] invalidate fetch query on submit --- apps/portal/src/pages/resumes/submit.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/portal/src/pages/resumes/submit.tsx b/apps/portal/src/pages/resumes/submit.tsx index 92a1c392..28b7a3b6 100644 --- a/apps/portal/src/pages/resumes/submit.tsx +++ b/apps/portal/src/pages/resumes/submit.tsx @@ -80,6 +80,7 @@ export default function SubmitResumeForm({ const { data: session, status } = useSession(); const router = useRouter(); + const trpcContext = trpc.useContext(); const resumeUpsertMutation = trpc.useMutation('resumes.resume.user.upsert'); const isNewForm = initFormDetails == null; @@ -170,6 +171,7 @@ export default function SubmitResumeForm({ }, onSuccess() { if (isNewForm) { + trpcContext.invalidateQueries('resumes.resume.findAll'); router.push('/resumes/browse'); } else { onClose(); @@ -228,7 +230,7 @@ export default function SubmitResumeForm({ Upload a Resume -
+