From e6ac7176235e964a70c63f01b6117b9b2d75af0c Mon Sep 17 00:00:00 2001 From: Yuri Yaryshev Date: Thu, 29 Oct 2026 11:14:18 +0300 Subject: [PATCH] =?UTF-8?q?todo=5Fservice:=20POST=20/todos=20=D0=B2=D0=BE?= =?UTF-8?q?=D0=B7=D0=B2=D1=80=D0=B0=D1=89=D0=B0=D0=B5=D1=82=20todo=20(?= =?UTF-8?q?=D0=BF=D0=BE=20API)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- packages/todo_service/src/core.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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:"). */