bukopin-redemption-client-r.../src/common/stores/withdraw.js
Rifqy Zacky Ariadhy 1a000700e6 Initial commit
2019-01-02 18:39:53 +07:00

34 lines
686 B
JavaScript

import { observable, action, computed } from 'mobx';
export default class WithdrawStore {
@observable isLoading = false;
@observable data = {
amount: '',
bank_account_number: '',
bank_name: '',
destination_user_bank_id : ''
};
@observable bank = {
name: '',
account_number: ''
}
constructor(context) {
this.context = context;
this.http = context.http;
}
@action
createWithdraw() {
this.isLoading = true;
return this.http.post("withdraw/create", this.data)
.then(res => {
this.isLoading = false;
return res;
})
.catch(err => {
this.isLoading = false;
throw err;
})
}
}