From 08b7437803547f2e1876d0d4fc1a998dc0097457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoni=20Nu=C3=B1ez=20Romeu?= Date: Thu, 16 Jul 2026 16:40:41 +0200 Subject: [PATCH] fix: add 'seed' and 'manual' to valid product sources Products created via seed script or manual entry have source='seed' or 'manual', which wasn't in the valid sources list. --- apps/backend/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/backend/server.js b/apps/backend/server.js index 90c4a8a..a47f34b 100644 --- a/apps/backend/server.js +++ b/apps/backend/server.js @@ -2125,8 +2125,8 @@ app.post('/api/admin/pharmacy-products', requireAdmin, async (req, res) => { return res.status(400).json({ error: 'pharmacy_id, product_source, and product_off_id are required' }); } - // Allow both CIMA and parapharmacy sources - const validSources = ['cima', 'promofarma', 'docmorris', 'primor', 'parapharmacy']; + // Allow CIMA and all parapharmacy sources + const validSources = ['cima', 'promofarma', 'docmorris', 'primor', 'parapharmacy', 'seed', 'manual']; if (!validSources.includes(product_source)) { return res.status(400).json({ error: `product_source must be one of: ${validSources.join(', ')}` }); }