fix: cycle date check wrong projectId (#3972)

This commit is contained in:
Aaryan Khandelwal 2024-03-14 20:11:10 +05:30 committed by GitHub
parent 42b524b16a
commit aaad37575b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,10 +96,10 @@ export const CycleCreateUpdateModal: React.FC<CycleModalProps> = (props) => {
}); });
}; };
const dateChecker = async (payload: CycleDateCheckData) => { const dateChecker = async (projectId: string, payload: CycleDateCheckData) => {
let status = false; 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; status = res.status;
}); });
@ -117,13 +117,13 @@ export const CycleCreateUpdateModal: React.FC<CycleModalProps> = (props) => {
if (payload.start_date && payload.end_date) { if (payload.start_date && payload.end_date) {
if (data?.start_date && data?.end_date) if (data?.start_date && data?.end_date)
isDateValid = await dateChecker({ isDateValid = await dateChecker(payload.project_id ?? projectId, {
start_date: payload.start_date, start_date: payload.start_date,
end_date: payload.end_date, end_date: payload.end_date,
cycle_id: data.id, cycle_id: data.id,
}); });
else else
isDateValid = await dateChecker({ isDateValid = await dateChecker(payload.project_id ?? projectId, {
start_date: payload.start_date, start_date: payload.start_date,
end_date: payload.end_date, end_date: payload.end_date,
}); });