This commit is contained in:
seb
2026-10-17 23:31:40 +02:00
parent 4bd977ed12
commit df846f4f06
3 changed files with 10 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ _No content_
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Supplier not found — `{"error":"…"}` |
| 409 | Supplier in use — `{"error":"…"}` |
---

View File

@@ -19,6 +19,8 @@ function entityErrorStatus(error) {
if (error.message === 'Name required') return 400;
if (error.message === 'Number required') return 400;
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 role') return 400;
return 500;

View File

@@ -17,6 +17,7 @@ function supplierErrorStatus(error) {
if (error.message === 'Supplier not found') return 404;
if (error.message === 'Supplier required') return 400;
if (error.message === 'Name required') return 400;
if (error.message === 'Supplier in use') return 409;
return 500;
}
@@ -307,6 +308,12 @@ export function register(app, basePath = '') {
* application/json:
* schema:
* $ref: '#/components/schemas/Error'
* 409:
* description: Supplier in use
* content:
* application/json:
* schema:
* $ref: '#/components/schemas/Error'
*/
// #region PATCH /supplier/:id