diff options
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 +} |
