diff options
| author | trisusilo <tri.susilo@altama.co.id> | 2023-07-26 06:38:16 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2023-07-26 06:38:16 +0000 |
| commit | 1cb955105874fb9aa49d5b8323762f6780ff2f38 (patch) | |
| tree | 4973cb16e9c0e03b2956f7f700fe51b3593b626f /src/core/utils/cart.js | |
| parent | a72a7503dd5f04c9f3db5a3803dce0610fcff7ea (diff) | |
| parent | d6761519478ba351099b5d60083f318ad0812305 (diff) | |
Merged in Hotfix/action_click_button_beli (pull request #26)
Hotfix/action click button beli
Diffstat (limited to 'src/core/utils/cart.js')
| -rw-r--r-- | src/core/utils/cart.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/utils/cart.js b/src/core/utils/cart.js index 16befdf7..dcb104f9 100644 --- a/src/core/utils/cart.js +++ b/src/core/utils/cart.js @@ -30,12 +30,13 @@ const setCart = (cart) => { return false } -const addCart = async (product_id, qty, selected, programLineId = null) => { +const addCart = async (product_id, qty, selected, programLineId = null, source) => { const data = { 'product_id' : product_id, 'qty' : qty, 'selected' : selected, - 'program_line_id' : programLineId + 'program_line_id' : programLineId, + 'source' : source } const id = getAuth()?.id @@ -94,12 +95,12 @@ const getItemCart = ({ productId }) => { * @param {boolean} [options.selected=false] - The new selected status of the product in the cart. Default is `false`. * @returns {boolean} - Returns `true`. */ -const updateItemCart = async ({ productId, quantity, selected = false , programLineId}) => { +const updateItemCart = async ({ productId, quantity, selected = false , programLineId, source}) => { let cart = getCart() quantity = parseInt(quantity) cart[productId] = { productId, quantity, selected } setCart(cart) - await addCart(productId, quantity, selected, programLineId) + await addCart(productId, quantity, selected, programLineId, source) return true } |
