This commit is contained in:
seb
2026-10-04 21:22:02 +02:00
parent 45369d11da
commit 3ac713732c
12 changed files with 92 additions and 92 deletions

View File

@@ -20,7 +20,7 @@ function stockErrorStatus(error) {
if (error.message?.includes('Amount must be')) return 400;
if (error.message?.includes('Invalid amount')) return 400;
if (error.message === 'No items to adjust') return 400;
if (error.message?.includes('cannot have stock') || error.message?.includes('A father article cannot have') || error.message?.includes('father article') || error.message?.includes('Stückliste')) return 400;
if (error.message?.includes('cannot have stock') || error.message?.includes('A parent article cannot have') || error.message?.includes('parent article') || error.message?.includes('Stückliste')) return 400;
if (error.message?.includes('Stock tracking is disabled')) return 409;
return 500;
}
@@ -86,7 +86,7 @@ export function register(app, basePath = '') {
* schema:
* $ref: '#/components/schemas/StockAdjustmentResult'
* 400:
* description: Missing fields, invalid amount, father article cannot have stock, or no company selected
* description: Missing fields, invalid amount, parent article cannot have stock, or no company selected
* content:
* application/json:
* schema: