u
This commit is contained in:
@@ -26,6 +26,7 @@ function articlePropertyErrorStatus(error) {
|
||||
if (error.message === 'Not authorized') return 403;
|
||||
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('Exclusive property cannot be overwritten')) return 409;
|
||||
if (error.message === 'Invalid properties array' || error.message === 'Invalid propertyId' || error.message === 'Duplicate propertyId') return 400;
|
||||
return 500;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ function propertyErrorStatus(error) {
|
||||
if (error.message === 'Name required') return 400;
|
||||
if (error.message === 'Invalid property name order') 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user