diff options
| author | trisusilo <tri.susilo@altama.co.id> | 2023-07-24 08:35:11 +0000 |
|---|---|---|
| committer | trisusilo <tri.susilo@altama.co.id> | 2023-07-24 08:35:11 +0000 |
| commit | 5be5be868124e7d4b21ab2137f45006380e3d0a1 (patch) | |
| tree | d7c4151eb2bf83b85cd0532d45dedd02aa06694e /src/lib/checkout/api/checkoutApi.js | |
| parent | bed971bc1265cd9b0e6f0c01dcb57bf4089c21f9 (diff) | |
| parent | 2de322571bad7490baaf439fa2bb12124c646bb5 (diff) | |
Merged in CR/widget_WA (pull request #17)
CR/widget WA
Diffstat (limited to 'src/lib/checkout/api/checkoutApi.js')
| -rw-r--r-- | src/lib/checkout/api/checkoutApi.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/checkout/api/checkoutApi.js b/src/lib/checkout/api/checkoutApi.js index b76c9b7f..0d0cc918 100644 --- a/src/lib/checkout/api/checkoutApi.js +++ b/src/lib/checkout/api/checkoutApi.js @@ -1,7 +1,7 @@ import odooApi from '@/core/api/odooApi' import { getAuth } from '@/core/utils/auth' -const checkoutApi = async ({ data }) => { +export const checkoutApi = async ({ data }) => { const auth = getAuth() const dataCheckout = await odooApi( 'POST', @@ -11,4 +11,14 @@ const checkoutApi = async ({ data }) => { return dataCheckout } -export default checkoutApi +export const getProductsCheckout = async (voucher) => { + const id = getAuth()?.id + let products + if(voucher){ + products = await odooApi('GET',`/api/v1/user/${id}/sale_order/checkout?voucher=${voucher}`) + }else{ + products = await odooApi('GET',`/api/v1/user/${id}/sale_order/checkout`) + } + + return products +} |
