MCPcopy Create free account
hub / github.com/astercloud/aster / createTodo

Function createTodo

ui/src/stores/todos.ts:159–175  ·  view source on GitHub ↗
(todo: Omit<TodoItemData, "id" | "created_at" | "updated_at">)

Source from the content-addressed store, hash-verified

157 * 创建新 Todo (发送到后端)
158 */
159 const createTodo = async (todo: Omit<TodoItemData, "id" | "created_at" | "updated_at">) => {
160 const { getInstance } = useWebSocket();
161 const ws = getInstance();
162 if (ws) {
163 ws.send({
164 type: "todo_create",
165 payload: {
166 content: todo.content,
167 active_form: todo.active_form,
168 status: todo.status,
169 priority: todo.priority,
170 },
171 });
172 } else {
173 console.error("WebSocket not connected, cannot create todo");
174 }
175 };
176
177 /**
178 * 更新 Todo 状态 (发送到后端)

Callers

nothing calls this directly

Calls 3

useWebSocketFunction · 0.90
getInstanceFunction · 0.85
sendMethod · 0.45

Tested by

no test coverage detected