summaryrefslogtreecommitdiff
path: root/src/lib/checkout/api
diff options
context:
space:
mode:
authorHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-08-09 10:47:44 +0700
committerHATEC\SPVDEV001 <tri.susilo@altama.co.id>2023-08-09 10:47:44 +0700
commit407af81fb2d9ebdf3415fe7b34d08996ed7c80ec (patch)
tree675d0981a6259b814c3deb7bd053a85892fea53b /src/lib/checkout/api
parent9595223471946520f5c156e24eceb577fae4c901 (diff)
parent863047e92834479ce8edb576b57b129c611821a8 (diff)
Merge branch 'master' into CR/flash_sale
# Conflicts: # src/lib/product/components/ProductCard.jsx
Diffstat (limited to 'src/lib/checkout/api')
-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
}