This commit is contained in:
seb
2026-10-01 10:19:16 +02:00
parent 956fadcc8d
commit 8a7500cb5a
11 changed files with 59 additions and 19 deletions

View File

@@ -89,14 +89,19 @@ export function register(app, basePath = '') {
* properties:
* attributevalues:
* type: array
* description: Array of attribute value IDs (numbers) or objects with id or attributeValueId
* items:
* oneOf:
* - type: integer
* description: Attribute value ID
* - type: object
* required: [attributeValueId]
* properties:
* id:
* type: integer
* description: Attribute value ID
* attributeValueId:
* type: integer
* description: Attribute value ID
* sort:
* type: integer
* responses:
@@ -142,7 +147,7 @@ export function register(app, basePath = '') {
return res.status(400).json({ error: skuParsed.error });
}
const valuesInput = req.body?.attributevalues ?? req.body;
const valuesInput = req.body?.attributevalues ?? req.body?.attributeValues ?? req.body?.attribute_values ?? req.body?.values ?? req.body;
if (!Array.isArray(valuesInput)) {
return res.status(400).json({ error: 'attributevalues array required' });
}