From c5cb76a66c03246d43bbc212d5a962d41cd6f89e Mon Sep 17 00:00:00 2001 From: seb Date: Sun, 4 Oct 2026 16:22:25 +0200 Subject: [PATCH] u --- src/api/routes/articleproperty.js | 1 + src/api/routes/propertyname.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/routes/articleproperty.js b/src/api/routes/articleproperty.js index 9ecfa63..85224f7 100644 --- a/src/api/routes/articleproperty.js +++ b/src/api/routes/articleproperty.js @@ -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; } diff --git a/src/api/routes/propertyname.js b/src/api/routes/propertyname.js index 76188e9..425342a 100644 --- a/src/api/routes/propertyname.js +++ b/src/api/routes/propertyname.js @@ -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; }