favorites

This commit is contained in:
Daniel Goc
2026-04-09 14:49:50 +02:00
parent 9fb8e034fc
commit 393de36cb2
6 changed files with 65 additions and 20 deletions

View File

@@ -132,6 +132,12 @@ JSON_OBJECT(
m.name,
'category',
cl.name,
/* ================= FAVORITE ================= */
'is_favorite',
EXISTS(
SELECT 1 FROM b2b_favorites f
WHERE f.user_id = p_id_customer AND f.product_id = p_id_product
),
/* ================= IMAGE ================= */
'cover_image',
JSON_OBJECT(