Skip to content

Commit

Permalink
Merge pull request #94 from nicgirault/fix-40
Browse files Browse the repository at this point in the history
fix: make sure update always return the id of the record
  • Loading branch information
nicgirault authored Aug 19, 2023
2 parents 14afa9a + 364785b commit 0276cde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ export const update = <R>(
return res.status(404).json({ error: 'Record not found' })
}

res.json(await doUpdate(req.params.id, req.body, { req, res }))
const result = await doUpdate(req.params.id, req.body, { req, res })

res.json({
id: req.params.id,
...result
})
} catch (error) {
next(error)
}
Expand Down

0 comments on commit 0276cde

Please sign in to comment.