ini lah vouchers sesungguhnya
This commit is contained in:
@@ -7,6 +7,15 @@ export default class Vouchers {
|
||||
@observable istLoading = false;
|
||||
@observable isSearching = false;
|
||||
@observable filtered = [];
|
||||
@observable skuId = {} ;
|
||||
@observable skuName = {} ;
|
||||
@observable skuPrice = {} ;
|
||||
@observable dataItems = {
|
||||
name :'',
|
||||
images : {
|
||||
logo: ''
|
||||
}
|
||||
} ;
|
||||
|
||||
constructor(context) {
|
||||
this.http = context.http;
|
||||
@@ -19,7 +28,6 @@ export default class Vouchers {
|
||||
this.isLoading = true;
|
||||
return this.http.get("items")
|
||||
.then(res => {
|
||||
console.log(res.data,'res list')
|
||||
this.list = res.data;
|
||||
this.isLoading = false;
|
||||
})
|
||||
@@ -44,12 +52,16 @@ export default class Vouchers {
|
||||
}
|
||||
|
||||
@action
|
||||
post(data){
|
||||
buyVoucher(data){
|
||||
console.log('data',data)
|
||||
this.isLoading = true;
|
||||
return this.http.post("stores", data)
|
||||
.then(res => {
|
||||
return this.http.post("shop/buy_voucher", {
|
||||
item_sku_id : data
|
||||
}
|
||||
).then(res => {
|
||||
this.isLoading = false;
|
||||
this.getList();
|
||||
console.log('res',res)
|
||||
return res;
|
||||
})
|
||||
.catch(err => {
|
||||
|
||||
Reference in New Issue
Block a user