summaryrefslogtreecommitdiff
path: root/src/lib/checkout/components
diff options
context:
space:
mode:
authortrisusilo <tri.susilo@altama.co.id>2023-07-26 06:38:16 +0000
committertrisusilo <tri.susilo@altama.co.id>2023-07-26 06:38:16 +0000
commit1cb955105874fb9aa49d5b8323762f6780ff2f38 (patch)
tree4973cb16e9c0e03b2956f7f700fe51b3593b626f /src/lib/checkout/components
parenta72a7503dd5f04c9f3db5a3803dce0610fcff7ea (diff)
parentd6761519478ba351099b5d60083f318ad0812305 (diff)
Merged in Hotfix/action_click_button_beli (pull request #26)
Hotfix/action click button beli
Diffstat (limited to 'src/lib/checkout/components')
-rw-r--r--src/lib/checkout/components/Checkout.jsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/checkout/components/Checkout.jsx b/src/lib/checkout/components/Checkout.jsx
index 11a14e31..17616938 100644
--- a/src/lib/checkout/components/Checkout.jsx
+++ b/src/lib/checkout/components/Checkout.jsx
@@ -34,12 +34,13 @@ const { getProductsCheckout } = require('../api/checkoutApi')
const Checkout = () => {
const router = useRouter()
+ const query = router.query.source ?? null
const auth = useAuth()
const [activeVoucher, SetActiveVoucher] = useState(null)
const { data: cartCheckout } = useQuery('cartCheckout-' + activeVoucher, () =>
- getProductsCheckout(activeVoucher)
+ getProductsCheckout(activeVoucher, query)
)
const [selectedAddress, setSelectedAddress] = useState({
@@ -298,6 +299,9 @@ const Checkout = () => {
voucher: activeVoucher,
type: 'sale_order'
}
+ if(query){
+ data.source = 'buy'
+ }
if (poNumber.current.value) data.po_number = poNumber.current.value
if (typeof file !== 'undefined') data.po_file = await getFileBase64(file)