From ea68149a86437bd89dfcc608d602aa194cd3b436 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 15 Aug 2025 13:43:58 +0700
Subject: <hafid> fix alur repeat order

---
 src/lib/transaction/components/Transactions.jsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'src/lib/transaction/components/Transactions.jsx')

diff --git a/src/lib/transaction/components/Transactions.jsx b/src/lib/transaction/components/Transactions.jsx
index 2596b47f..893fbfbb 100644
--- a/src/lib/transaction/components/Transactions.jsx
+++ b/src/lib/transaction/components/Transactions.jsx
@@ -347,6 +347,7 @@ const Transactions = ({ context = '' }) => {
   const handleBuyBack = async (products) => {
     try {
       // setStatus('loading');
+      console.log("Products to add:", products);
 
       const results = await Promise.all(
         products.map((product) =>
@@ -356,8 +357,8 @@ const Transactions = ({ context = '' }) => {
             id: product.id,
             qty: product.quantity,
             selected: true,
-            source: 'buy',
-            qtyAppend: false,
+            source: 'add_to_cart',
+            qtyAppend: true,
           }).catch(error => {
             return { error, product };
           })
@@ -365,6 +366,7 @@ const Transactions = ({ context = '' }) => {
       );
 
       const failedOperations = results.filter(result => result && result.error);
+      console.log(results);
       
       if (failedOperations.length > 0) {
         console.error('Some products failed to add to cart:', failedOperations);
-- 
cgit v1.2.3

