From 480e89a0d2ccd274b956b4c4fb7ff520765c6606 Mon Sep 17 00:00:00 2001
From: Azka Nathan <darizkyfaz@gmail.com>
Date: Tue, 29 Apr 2025 14:53:53 +0700
Subject: fix bug flashsale

---
 src/lib/flashSale/components/FlashSaleNonDisplay.jsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/lib/flashSale/components/FlashSaleNonDisplay.jsx')

diff --git a/src/lib/flashSale/components/FlashSaleNonDisplay.jsx b/src/lib/flashSale/components/FlashSaleNonDisplay.jsx
index dc2b9fb5..adcc7ba0 100644
--- a/src/lib/flashSale/components/FlashSaleNonDisplay.jsx
+++ b/src/lib/flashSale/components/FlashSaleNonDisplay.jsx
@@ -19,8 +19,8 @@ const FlashSaleNonDisplay = () => {
     };
     loadFlashSales();
   }, []);
-  const handleSubmit = () => {
-    router.push(`/shop/search?penawaran=${flashSales[0]?.pricelistId}`);
+  const handleSubmit = (flashSale) => {
+    router.push(`/shop/search?penawaran=${flashSale?.pricelistId}`);
   };
   if (isLoading) {
     return <FlashSaleSkeleton />;
@@ -33,10 +33,10 @@ const FlashSaleNonDisplay = () => {
           <div key={index}>
             <div className='flex items-center mb-4 justify-between '>
               <div className='font-medium sm:text-h-lg mt-1.5'>
-                Penawaran Terbatas
+                {flashSale.name}
               </div>
               <div
-                onClick={handleSubmit}
+                onClick={() => handleSubmit(flashSale)}
                 className='!text-red-500 font-semibold cursor-pointer'
               >
                 Lihat Semua
@@ -56,7 +56,7 @@ const FlashSaleProduct = ({ flashSaleId }) => {
   useEffect(() => {
     const loadProducts = async () => {
       const dataProducts = await productSearchApi({
-        query: `fq=-flashsale_id_i:${flashSaleId}&fq=flashsale_price_f:[1 TO *]&limit=25&orderBy=flashsale-discount-desc&source=similar`,
+        query: `fq=flashsale_id_i:${flashSaleId}&fq=flashsale_price_f:[1 TO *]&limit=25&orderBy=flashsale-discount-desc&source=similar`,
         operation: 'AND',
       });
       setProducts(dataProducts.response);
-- 
cgit v1.2.3

