diff --git a/packages/todo_service/src/core.ts b/packages/todo_service/src/core.ts index 5230749..07f771b 100644 --- a/packages/todo_service/src/core.ts +++ b/packages/todo_service/src/core.ts @@ -473,12 +473,13 @@ export class TodoCore { const name = kind === "control" ? ensureControlPrefix(i.name) : i.name.trim(); const due = i.due ?? defaultDue(this.today(), this.d.settings.defaults.dueWorkdays, await this.nonWorkdays()); const assignees = await this.membershipIds(i); - return this.runWrite( + const r = await this.runWrite( "create", { jobId: i.jobId, name, description: i.description, due, assignees, kind, reviewDate: i.reviewDate, createdByKind: i.createdByKind ?? (caller.kind === "person" ? "agent" : "automation"), createdBy: i.createdBy ?? caller.name }, caller, key, ); + return r.status === "done" ? { ...r, todo: await this.get(caller, (r as { id: string }).id) } : r; } /** Пара Control: todo исполнителю (срок по умолчанию 3 рабочих дня) и Control todo контролёру (срок + 2 дня, название с "Control:"). */