fix(dashboard): forward removeDependencyReferences flag in deleteTask
useTasks.deleteTask had a single-arg signature and dropped the options object, so the modal's "remove dependency references" confirmation flag never reached the API and deletion still failed with TASK_HAS_DEPENDENTS. Forward options through the hook and widen the matching taskOperations.deleteTask type in AppModals. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
5
.changeset/dashboard-delete-dependency-flag.md
Normal file
5
.changeset/dashboard-delete-dependency-flag.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@runfusion/fusion": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix dashboard task deletion failing with "still referenced as a dependency" even after the user confirms removing dependency references. The `useTasks` hook's `deleteTask` was dropping its `options` argument, so the `removeDependencyReferences` flag from the confirmation flow never reached the API.
|
||||||
@@ -54,7 +54,7 @@ interface AppModalsProps {
|
|||||||
taskHandlers: Pick<UseTaskHandlersResult, "handleModalCreate" | "handlePlanningTaskCreated" | "handlePlanningTasksCreated" | "handleSubtaskTasksCreated" | "handleGitHubImport">;
|
taskHandlers: Pick<UseTaskHandlersResult, "handleModalCreate" | "handlePlanningTaskCreated" | "handlePlanningTasksCreated" | "handleSubtaskTasksCreated" | "handleGitHubImport">;
|
||||||
taskOperations: {
|
taskOperations: {
|
||||||
moveTask: (taskId: string, column: Column, optionsOrPosition?: { preserveProgress?: boolean } | number) => Promise<Task>;
|
moveTask: (taskId: string, column: Column, optionsOrPosition?: { preserveProgress?: boolean } | number) => Promise<Task>;
|
||||||
deleteTask: (taskId: string) => Promise<Task>;
|
deleteTask: (taskId: string, options?: { removeDependencyReferences?: boolean }) => Promise<Task>;
|
||||||
mergeTask: (taskId: string) => Promise<MergeResult>;
|
mergeTask: (taskId: string) => Promise<MergeResult>;
|
||||||
retryTask: (taskId: string) => Promise<Task>;
|
retryTask: (taskId: string) => Promise<Task>;
|
||||||
resetTask: (taskId: string) => Promise<Task>;
|
resetTask: (taskId: string) => Promise<Task>;
|
||||||
|
|||||||
@@ -345,8 +345,11 @@ export function useTasks(options?: UseTasksOptions) {
|
|||||||
return normalizeTask(await api.pauseTask(id, projectId));
|
return normalizeTask(await api.pauseTask(id, projectId));
|
||||||
}, [projectId]);
|
}, [projectId]);
|
||||||
|
|
||||||
const deleteTask = useCallback(async (id: string): Promise<Task> => {
|
const deleteTask = useCallback(async (
|
||||||
return normalizeTask(await api.deleteTask(id, projectId));
|
id: string,
|
||||||
|
options?: { removeDependencyReferences?: boolean },
|
||||||
|
): Promise<Task> => {
|
||||||
|
return normalizeTask(await api.deleteTask(id, projectId, options));
|
||||||
}, [projectId]);
|
}, [projectId]);
|
||||||
|
|
||||||
const mergeTask = useCallback(async (id: string): Promise<MergeResult> => {
|
const mergeTask = useCallback(async (id: string): Promise<MergeResult> => {
|
||||||
|
|||||||
Reference in New Issue
Block a user