()
| 60 | } |
| 61 | |
| 62 | async function getItems() { |
| 63 | return new Promise((acc, rej) => { |
| 64 | pool.query('SELECT * FROM todo_items', (err, rows) => { |
| 65 | if (err) return rej(err); |
| 66 | acc( |
| 67 | rows.map(item => |
| 68 | Object.assign({}, item, { |
| 69 | completed: item.completed === 1, |
| 70 | }), |
| 71 | ), |
| 72 | ); |
| 73 | }); |
| 74 | }); |
| 75 | } |
| 76 | |
| 77 | async function getItem(id) { |
| 78 | return new Promise((acc, rej) => { |
no outgoing calls
no test coverage detected
searching dependent graphs…