chore: add favorite field to base product query

This commit is contained in:
2026-04-14 11:07:55 +02:00
parent d173af29fe
commit ab783b599d
3 changed files with 12 additions and 13 deletions

View File

@@ -319,7 +319,8 @@ DROP PROCEDURE IF EXISTS get_product_base //
CREATE PROCEDURE get_product_base(
IN p_id_product INT,
IN p_id_shop INT,
IN p_id_lang INT
IN p_id_lang INT,
IN p_id_customer INT
)
BEGIN
SELECT
@@ -376,14 +377,12 @@ BEGIN
-- Relations
m.name AS manufacturer,
cl.name AS category
cl.name AS category,
-- This doesn't fit to base product, I'll add proper is_favorite to product later
-- EXISTS(
-- SELECT 1 FROM b2b_favorites f
-- WHERE f.user_id = p_id_customer AND f.product_id = p_id_product
-- ) AS is_favorite
EXISTS(
SELECT 1 FROM b2b_favorites f
WHERE f.user_id = p_id_customer AND f.product_id = p_id_product
) AS is_favorite