diff --git a/services/madoc-ts/src/frontend/site/features/canvas/CanvasTaskProgress.tsx b/services/madoc-ts/src/frontend/site/features/canvas/CanvasTaskProgress.tsx index 68840b51c..252490774 100644 --- a/services/madoc-ts/src/frontend/site/features/canvas/CanvasTaskProgress.tsx +++ b/services/madoc-ts/src/frontend/site/features/canvas/CanvasTaskProgress.tsx @@ -49,7 +49,7 @@ export const CanvasTaskProgress: React.FC = () => { const [markAsComplete, markAsCompleteStatus] = useMutation(async () => { if (canvasTask) { - await api.updateTask(canvasTask.id, { + await api.updateRevisionTask(canvasTask.id, { status: 3, status_text: 'completed', }); @@ -64,7 +64,7 @@ export const CanvasTaskProgress: React.FC = () => { const [markAsIncomplete, markAsIncompleteStatus] = useMutation(async () => { if (canvasTask) { - await api.updateTask(canvasTask.id, { + await api.updateRevisionTask(canvasTask.id, { status: 2, status_text: 'in progress', }); @@ -74,7 +74,7 @@ export const CanvasTaskProgress: React.FC = () => { const [updateRequiredApprovals, updateRequiredApprovalsStatus] = useMutation(async () => { if (canvasTask) { - await api.updateTask(canvasTask.id, { + await api.updateRevisionTask(canvasTask.id, { state: { approvalsRequired: requiredApprovals, }, diff --git a/services/madoc-ts/src/frontend/site/features/manifest/ManifestTaskProgress.tsx b/services/madoc-ts/src/frontend/site/features/manifest/ManifestTaskProgress.tsx index d73f46138..2a60b2923 100644 --- a/services/madoc-ts/src/frontend/site/features/manifest/ManifestTaskProgress.tsx +++ b/services/madoc-ts/src/frontend/site/features/manifest/ManifestTaskProgress.tsx @@ -42,7 +42,7 @@ export const ManifestTaskProgress: React.FC = () => { const [markAsComplete, markAsCompleteStatus] = useMutation(async () => { if (manifestTask) { - await api.updateTask(manifestTask.id, { + await api.updateRevisionTask(manifestTask.id, { status: 3, status_text: 'completed', }); @@ -52,7 +52,7 @@ export const ManifestTaskProgress: React.FC = () => { const [markAsIncomplete, markAsIncompleteStatus] = useMutation(async () => { if (manifestTask) { - await api.updateTask(manifestTask.id, { + await api.updateRevisionTask(manifestTask.id, { status: 2, status_text: 'in progress', }); @@ -62,7 +62,7 @@ export const ManifestTaskProgress: React.FC = () => { const [updateRequiredApprovals, updateRequiredApprovalsStatus] = useMutation(async () => { if (manifestTask) { - await api.updateTask(manifestTask.id, { + await api.updateRevisionTask(manifestTask.id, { state: { approvalsRequired: requiredApprovals, }, diff --git a/services/madoc-ts/src/routes/projects/update-revision-task.ts b/services/madoc-ts/src/routes/projects/update-revision-task.ts index 452fb0cd4..8cf004309 100644 --- a/services/madoc-ts/src/routes/projects/update-revision-task.ts +++ b/services/madoc-ts/src/routes/projects/update-revision-task.ts @@ -29,7 +29,11 @@ export const updateRevisionTask: RouteMiddleware<{ taskId: string; task: any }> throw new Error('Task could not be updated, no body'); } - if (task.type !== 'crowdsourcing-task') { + if ( + task.type !== 'crowdsourcing-task' && + task.type !== 'crowdsourcing-manifest-task' && + task.type !== 'crowdsourcing-canvas-task' + ) { throw new Error(`Task could not be updated, not a valid task`); }