plane/web/components/issues/issue-layouts/calendar/utils.ts
rahulramesha d8ab3e0087
[WEB-1139] chore: Calendar pragmatic dnd (#4410)
* replace Pragmatic DND for calendar

* remove unnecessary check
2024-05-09 15:51:49 +05:30

22 lines
579 B
TypeScript

import { TIssue } from "@plane/types";
export const handleDragDrop = async (
issueId: string,
sourceDate: string,
destinationDate: string,
workspaceSlug: string | undefined,
projectId: string | undefined,
updateIssue?: (projectId: string, issueId: string, data: Partial<TIssue>) => Promise<void>
) => {
if (!workspaceSlug || !projectId || !updateIssue) return;
if (sourceDate === destinationDate) return;
const updatedIssue = {
id: issueId,
target_date: destinationDate,
};
return await updateIssue(projectId, updatedIssue.id, updatedIssue);
};