This commit is contained in:
seb
2026-09-29 18:48:13 +02:00
parent 63af77eab3
commit 79b48c5d47
2 changed files with 3 additions and 1 deletions

View File

@@ -71,7 +71,8 @@ function articleErrorStatus(error) {
if (error.message === 'Invalid categoryIds') return 400;
if (error.message === 'Attribute name not found') return 404;
if (error.message === 'attributeNameId is required to become a father article') return 400;
if (error.message === 'A child article cannot become a father') return 400;
if (error.message?.includes('already used by an ancestor father')) return 400;
if (error.message?.includes('cannot have attribute values for its variant attribute')) return 400;
if (error.message === 'Cannot disable father mode on an article that still has children') return 400;
if (error.message === 'Article is not a father article') return 400;
if (error.message === 'Attribute value is required for child article' || error.message === 'Attribute value is required') return 400;

View File

@@ -27,6 +27,7 @@ function articleAttributeValueErrorStatus(error) {
if (error.message === 'Company not found' || error.message === 'Article not found') return 404;
if (error.message?.startsWith('Attribute value not found')) return 404;
if (error.message?.includes('exclusive')) return 400;
if (error.message?.includes('father article') || error.message?.includes('Child article must have')) return 400;
if (error.message === 'Invalid attribute values array' || error.message === 'Invalid attributeValueId' || error.message === 'Duplicate attributeValueId') return 400;
return 500;
}