From aaad37575be7ef1d64db51d3e31d1dbb9f54b68f Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Thu, 14 Mar 2024 20:11:10 +0530 Subject: [PATCH] fix: cycle date check wrong projectId (#3972) --- web/components/cycles/modal.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/components/cycles/modal.tsx b/web/components/cycles/modal.tsx index b22afb2b4..41b7033b0 100644 --- a/web/components/cycles/modal.tsx +++ b/web/components/cycles/modal.tsx @@ -96,10 +96,10 @@ export const CycleCreateUpdateModal: React.FC = (props) => { }); }; - const dateChecker = async (payload: CycleDateCheckData) => { + const dateChecker = async (projectId: string, payload: CycleDateCheckData) => { let status = false; - await cycleService.cycleDateCheck(workspaceSlug as string, projectId as string, payload).then((res) => { + await cycleService.cycleDateCheck(workspaceSlug, projectId, payload).then((res) => { status = res.status; }); @@ -117,13 +117,13 @@ export const CycleCreateUpdateModal: React.FC = (props) => { if (payload.start_date && payload.end_date) { if (data?.start_date && data?.end_date) - isDateValid = await dateChecker({ + isDateValid = await dateChecker(payload.project_id ?? projectId, { start_date: payload.start_date, end_date: payload.end_date, cycle_id: data.id, }); else - isDateValid = await dateChecker({ + isDateValid = await dateChecker(payload.project_id ?? projectId, { start_date: payload.start_date, end_date: payload.end_date, });