feat(FN-3185): preserve progress on task reset with explicit confirmation d
This merge implements a "preserve progress" option for task resets across the system. FN-3185 adds a `preserveProgress` flag to `moveTask` that keeps status/history when resetting tasks back to `todo`, with required explicit confirmation dialogs to prevent accidental resets. The feature is wired thr Fusion-Task-Id: FN-3185
This commit is contained in:
@@ -214,11 +214,16 @@ export function registerTaskWorkflowRoutes(ctx: ApiRoutesContext, deps: TaskWork
|
||||
router.post("/tasks/:id/move", async (req, res) => {
|
||||
try {
|
||||
const { store: scopedStore } = await getProjectContext(req);
|
||||
const { column } = req.body;
|
||||
const { column, preserveProgress } = req.body;
|
||||
if (!column || !COLUMNS.includes(column as Column)) {
|
||||
throw badRequest(`Invalid column. Must be one of: ${COLUMNS.join(", ")}`);
|
||||
}
|
||||
const task = await scopedStore.moveTask(req.params.id, column as Column);
|
||||
if (preserveProgress != null && typeof preserveProgress !== "boolean") {
|
||||
throw badRequest("preserveProgress must be a boolean");
|
||||
}
|
||||
const task = await scopedStore.moveTask(req.params.id, column as Column, {
|
||||
preserveProgress,
|
||||
});
|
||||
res.json(task);
|
||||
} catch (err: unknown) {
|
||||
if (err instanceof ApiError) {
|
||||
|
||||
Reference in New Issue
Block a user