u
This commit is contained in:
@@ -28,6 +28,7 @@ _No content_
|
|||||||
| 401 | Unauthorized — `{"error":"…"}` |
|
| 401 | Unauthorized — `{"error":"…"}` |
|
||||||
| 403 | Not authorized — `{"error":"…"}` |
|
| 403 | Not authorized — `{"error":"…"}` |
|
||||||
| 404 | Supplier not found — `{"error":"…"}` |
|
| 404 | Supplier not found — `{"error":"…"}` |
|
||||||
|
| 409 | Supplier in use — `{"error":"…"}` |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ function entityErrorStatus(error) {
|
|||||||
if (error.message === 'Name required') return 400;
|
if (error.message === 'Name required') return 400;
|
||||||
if (error.message === 'Number required') return 400;
|
if (error.message === 'Number required') return 400;
|
||||||
if (error.message === 'Number already in use') return 409;
|
if (error.message === 'Number already in use') return 409;
|
||||||
|
if (error.message === 'Entity in use') return 409;
|
||||||
|
if (error.message === 'Supplier in use') return 409;
|
||||||
if (error.message === 'Invalid customergroupId') return 400;
|
if (error.message === 'Invalid customergroupId') return 400;
|
||||||
if (error.message === 'Invalid role') return 400;
|
if (error.message === 'Invalid role') return 400;
|
||||||
return 500;
|
return 500;
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ function supplierErrorStatus(error) {
|
|||||||
if (error.message === 'Supplier not found') return 404;
|
if (error.message === 'Supplier not found') return 404;
|
||||||
if (error.message === 'Supplier required') return 400;
|
if (error.message === 'Supplier required') return 400;
|
||||||
if (error.message === 'Name required') return 400;
|
if (error.message === 'Name required') return 400;
|
||||||
|
if (error.message === 'Supplier in use') return 409;
|
||||||
return 500;
|
return 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,6 +308,12 @@ export function register(app, basePath = '') {
|
|||||||
* application/json:
|
* application/json:
|
||||||
* schema:
|
* schema:
|
||||||
* $ref: '#/components/schemas/Error'
|
* $ref: '#/components/schemas/Error'
|
||||||
|
* 409:
|
||||||
|
* description: Supplier in use
|
||||||
|
* content:
|
||||||
|
* application/json:
|
||||||
|
* schema:
|
||||||
|
* $ref: '#/components/schemas/Error'
|
||||||
*/
|
*/
|
||||||
// #region PATCH /supplier/:id
|
// #region PATCH /supplier/:id
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user