diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-09-01 09:36:52 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-09-01 09:36:52 +0700 |
| commit | dfdeedf7141c9191952bdb3005e2e91d2a495044 (patch) | |
| tree | 2abb9a8090306791a76069baff6c91c5e151d3b5 /src/lib/checkout/api | |
| parent | 57540da51be35b2d0a90f1d64b097fc4da608a25 (diff) | |
| parent | 7356bcc0d1b7bac8d05ac315fdcf2a46b3996e91 (diff) | |
Merge branch 'master' into Feature/google_sign_up
# Conflicts:
# src/core/components/elements/Navbar/NavbarDesktop.jsx
Diffstat (limited to 'src/lib/checkout/api')
| -rw-r--r-- | src/lib/checkout/api/getVoucher.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/lib/checkout/api/getVoucher.js b/src/lib/checkout/api/getVoucher.js index 57d8acf5..07cf376e 100644 --- a/src/lib/checkout/api/getVoucher.js +++ b/src/lib/checkout/api/getVoucher.js @@ -1,11 +1,21 @@ import odooApi from '@/core/api/odooApi' -export const getVoucher = async (id) => { - const dataVoucher = await odooApi('GET', `/api/v1/user/${id}/voucher`) +export const getVoucher = async (id, source) => { + let dataVoucher = null + if(source){ + dataVoucher = await odooApi('GET', `/api/v1/user/${id}/voucher?source=${source}`) + }else { + dataVoucher = await odooApi('GET', `/api/v1/user/${id}/voucher`) + } return dataVoucher } -export const findVoucher = async (code, id) => { - const dataVoucher = await odooApi('GET', `/api/v1/user/${id}/voucher?code=${code}`) +export const findVoucher = async (code, id, source) => { + let dataVoucher = null + if(source){ + dataVoucher = await odooApi('GET', `/api/v1/user/${id}/voucher?code=${code}&source=${source}`) + }else{ + dataVoucher = await odooApi('GET', `/api/v1/user/${id}/voucher?code=${code}`) + } return dataVoucher } |
