Add created id to response of category api
This commit is contained in:
parent
64c14db183
commit
533bc1744d
@ -42,10 +42,13 @@ function post(req: Request, res: Response) {
|
||||
data: {
|
||||
name: req.body.name,
|
||||
description: req.body.description
|
||||
},
|
||||
select: {
|
||||
id: true
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
res.status(201).json({ status: 'created' });
|
||||
.then((data) => {
|
||||
res.status(201).json({ status: 'created', id: data.id });
|
||||
})
|
||||
.catch((err) => {
|
||||
// Check if an entry already exists.
|
||||
|
Loading…
Reference in New Issue
Block a user