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