summaryrefslogtreecommitdiff
path: root/src/lib/checkout/api/getVoucher.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/checkout/api/getVoucher.js')
-rw-r--r--src/lib/checkout/api/getVoucher.js18
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
}