Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ammezie's full-sized avatar

Chimezie Enyinnaya ammezie

View GitHub Profile
// start/routes.js
Route.get('tasks/:id/edit', 'TaskController.edit') // updated this slightly
Route.patch('tasks/:id', 'TaskController.update')
// For the PATCH method, you might want to take a look at - http://dev.adonisjs.com/docs/4.0/request#_method_spoofing
// TaskController.js
async update ({ request, params, response, session }) {
// Get the task you want to update
const task = await Task.find(params.id)