Feat/parapharmacy api #38

Merged
Ichitux merged 25 commits from feat/parapharmacy-api into main 2026-07-16 15:38:59 +00:00
Showing only changes of commit e5dcfbd2f5 - Show all commits
+4 -2
View File
@@ -2125,8 +2125,10 @@ 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' });
}
if (product_source !== 'cima') {
return res.status(400).json({ error: 'product_source must be "cima"' });
// Allow both CIMA and parapharmacy sources
const validSources = ['cima', 'promofarma', 'docmorris', 'primor', 'parapharmacy'];
if (!validSources.includes(product_source)) {
return res.status(400).json({ error: `product_source must be one of: ${validSources.join(', ')}` });
}
const existing = await userDbGet(