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

Method get

todomvc/app/service/todo.js:37–41  ·  view source on GitHub ↗

* get todo details, will throw is not found * @param {String} id - todo id

(id)

Source from the content-addressed store, hash-verified

35 * @param {String} id - todo id
36 */
37 async get(id) {
38 const item = await this.Todo.findByPk(id);
39 if (!item) this.ctx.throw(500, `task#${id} not found`);
40 return item;
41 }
42
43 /**
44 * create todo

Callers 5

updateMethod · 0.95
destroyMethod · 0.95
home.test.jsFile · 0.45
router.jsFile · 0.45
main.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected