(id)
| 75 | } |
| 76 | |
| 77 | async function getItem(id) { |
| 78 | return new Promise((acc, rej) => { |
| 79 | pool.query('SELECT * FROM todo_items WHERE id=?', [id], (err, rows) => { |
| 80 | if (err) return rej(err); |
| 81 | acc( |
| 82 | rows.map(item => |
| 83 | Object.assign({}, item, { |
| 84 | completed: item.completed === 1, |
| 85 | }), |
| 86 | )[0], |
| 87 | ); |
| 88 | }); |
| 89 | }); |
| 90 | } |
| 91 | |
| 92 | async function storeItem(item) { |
| 93 | return new Promise((acc, rej) => { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…