A To do card on server pages and in a device's drawer

- The open jobs about a server (or device) are listed on its page, with a line to add another already about it and a box to tick one off with Undo
- GET /api/todos takes ?targetType=&targetId= to list only those about one thing
- README and ROLES updated

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-10-20 22:46:12 +02:00
1 parent 18ceed62e8
commit 788b3e073c
10 files changed
+164 -9

No files matched your search

+2 -1
View File
@@ -2388,7 +2388,8 @@ export const api = {
get: () => request<MyWork>("/api/my-work"),
},
todos: {
list: () => request<{ todos: TodoItem[]; people: { id: number; name: string; role: string }[] }>("/api/todos"),
list: (about?: { type: "server" | "device"; id: number }) =>
request<{ todos: TodoItem[]; people: { id: number; name: string; role: string }[] }>(`/api/todos${about ? `?targetType=${about.type}&targetId=${about.id}` : ""}`),
create: (data: TodoInput) => request<{ todo: TodoItem }>("/api/todos", { method: "POST", body: JSON.stringify(data) }),
update: (id: number, data: Partial<TodoInput> & { done?: boolean }) => request<{ todo: TodoItem }>(`/api/todos/${id}`, { method: "PATCH", body: JSON.stringify(data) }),
remove: (id: number) => request<void>(`/api/todos/${id}`, { method: "DELETE" }),