This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) |