July 2018
Beginner
100 pages
2h 7m
English
In this exercise, we will be introducing the last vital Knex method to complete our Create, Read, Update, Delete (CRUD) journey, .delete():
{ method: 'DELETE', path: '/todo/{todoId}/item/{id}', handler: async (request, reply) => { const id = request.params.id; const deleted = await Knex('todo_item') .where('id', id) .delete(); return reply({ message: 'deleted' }); },},

Read now
Unlock full access