fix: validate the not found items in delete items/item.

This commit is contained in:
a.bouhuolia
2021-01-02 15:13:18 +02:00
parent 905cbbed70
commit 149464fa7a
2 changed files with 22 additions and 6 deletions

View File

@@ -428,6 +428,11 @@ export default class ItemsController extends BaseController {
errors: [{ type: 'ITEM.NOT.FOUND', code: 140 }],
});
}
if (error.errorType === 'ITEMS_NOT_FOUND') {
return res.status(400).send({
errors: [{ type: 'ITEMS_NOT_FOUND', code: 130 }],
});
}
if (error.errorType === 'ITEM_CATEOGRY_NOT_FOUND') {
return res.status(400).send({
errors: [{ type: 'ITEM_CATEGORY.NOT.FOUND', code: 140 }],