MCPcopy
hub / github.com/eggjs/examples / update

Method update

todomvc/app/service/todo.js:63–68  ·  view source on GitHub ↗

* update todo info * * @param {String} id - todo id * @param {Todo} todo - data to updated

(id, todo)

Source from the content-addressed store, hash-verified

61 * @param {Todo} todo - data to updated
62 */
63 async update(id, todo) {
64 const data = await this.get(id);
65 if (!todo.title) this.ctx.throw(442, 'task title required');
66 await data.update(todo);
67 return data;
68 }
69
70 /**
71 * delete todo

Callers

nothing calls this directly

Calls 1

getMethod · 0.95

Tested by

no test coverage detected