mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
d8ab3e0087
* replace Pragmatic DND for calendar * remove unnecessary check
22 lines
579 B
TypeScript
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);
|
|
};
|