From e3a114cd69b5c9aa4c9e00c167dd234c1dd6c3f6 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 19 May 2023 16:15:06 +0530 Subject: [PATCH] fix: module and cycle create issue in calendar view mutation fix (#1079) --- apps/app/components/issues/modal.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/app/components/issues/modal.tsx b/apps/app/components/issues/modal.tsx index eae935479..acda96a84 100644 --- a/apps/app/components/issues/modal.tsx +++ b/apps/app/components/issues/modal.tsx @@ -138,12 +138,12 @@ export const CreateUpdateIssueModal: React.FC = ({ const createIssue = async (payload: Partial) => { await issuesService .createIssues(workspaceSlug as string, activeProject ?? "", payload) - .then((res) => { + .then(async (res) => { mutate(PROJECT_ISSUES_LIST_WITH_PARAMS(activeProject ?? "", params)); - if (issueView === "calendar") mutate(calendarFetchKey); + if (payload.cycle && payload.cycle !== "") await addIssueToCycle(res.id, payload.cycle); + if (payload.module && payload.module !== "") await addIssueToModule(res.id, payload.module); - if (payload.cycle && payload.cycle !== "") addIssueToCycle(res.id, payload.cycle); - if (payload.module && payload.module !== "") addIssueToModule(res.id, payload.module); + if (issueView === "calendar") mutate(calendarFetchKey); if (!createMore) handleClose();