This commit is contained in:
seb
2026-10-04 16:22:25 +02:00
parent 43fa8ea105
commit c5cb76a66c
2 changed files with 2 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ function articlePropertyErrorStatus(error) {
if (error.message === 'Not authorized') return 403; if (error.message === 'Not authorized') return 403;
if (error.message === 'Company not found' || error.message === 'Article not found') return 404; if (error.message === 'Company not found' || error.message === 'Article not found') return 404;
if (error.message?.startsWith('Property not found')) return 404; if (error.message?.startsWith('Property not found')) return 404;
if (error.message?.startsWith('Exclusive property cannot be overwritten')) return 409;
if (error.message === 'Invalid properties array' || error.message === 'Invalid propertyId' || error.message === 'Duplicate propertyId') return 400; if (error.message === 'Invalid properties array' || error.message === 'Invalid propertyId' || error.message === 'Duplicate propertyId') return 400;
return 500; return 500;
} }

View File

@@ -17,7 +17,7 @@ function propertyErrorStatus(error) {
if (error.message === 'Name required') return 400; if (error.message === 'Name required') return 400;
if (error.message === 'Invalid property name order') return 400; if (error.message === 'Invalid property name order') return 400;
if (error.message === 'Invalid id') return 400; if (error.message === 'Invalid id') return 400;
if (error.message === 'Property name in use' || error.message?.includes('FOREIGN KEY constraint')) return 409; if (error.message === 'Property name in use' || error.message?.startsWith('Cannot set property exclusive') || error.message?.includes('FOREIGN KEY constraint')) return 409;
return 500; return 500;
} }