ini lah vouchers sesungguhnya

This commit is contained in:
2019-01-06 18:10:57 +07:00
parent 6572d4609e
commit 21c56ad40f
5 changed files with 83 additions and 29 deletions

View File

@@ -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 => {