fix transaction

This commit is contained in:
Hasta Ragil Saputra 2019-01-29 18:12:44 +07:00
parent e8945f7608
commit b5afc1b120
2 changed files with 36 additions and 34 deletions

View File

@ -53,6 +53,7 @@ export default class WalletComponent extends React.Component {
} }
componentDidMount() { componentDidMount() {
this.props.appstate.transaction.getAll();
this.purchasedItemStore.getAll().then(res => { this.purchasedItemStore.getAll().then(res => {
console.log(res, 'ini purchased items') console.log(res, 'ini purchased items')
}) })
@ -74,38 +75,39 @@ export default class WalletComponent extends React.Component {
const voucher = <NumberFormat value={(this.props.appstate.wallet.data.wallet).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '}/>; const voucher = <NumberFormat value={(this.props.appstate.wallet.data.wallet).toFixed(2)} displayType={'text'} thousandSeparator={true} prefix={'Rp '}/>;
const points = <NumberFormat value={this.props.appstate.wallet.data.point} displayType={'text'} thousandSeparator={true}/>; const points = <NumberFormat value={this.props.appstate.wallet.data.point} displayType={'text'} thousandSeparator={true}/>;
const data = [ // const data = [
{ // {
id: faker.random.uuid(), // id: faker.random.uuid(),
created_at: faker.date.past(), // created_at: faker.date.past(),
type: 'Points', // type: 'Points',
amount: faker.commerce.price() // amount: faker.commerce.price()
}, // },
{ // {
id: faker.random.uuid(), // id: faker.random.uuid(),
created_at: faker.date.past(), // created_at: faker.date.past(),
type: 'Points', // type: 'Points',
amount: faker.commerce.price() // amount: faker.commerce.price()
}, // },
{ // {
id: faker.random.uuid(), // id: faker.random.uuid(),
created_at: faker.date.past(), // created_at: faker.date.past(),
type: 'Voucher', // type: 'Voucher',
amount: faker.commerce.price() // amount: faker.commerce.price()
}, // },
{ // {
id: faker.random.uuid(), // id: faker.random.uuid(),
created_at: faker.date.past(), // created_at: faker.date.past(),
type: 'Voucher', // type: 'Voucher',
amount: faker.commerce.price() // amount: faker.commerce.price()
}, // },
{ // {
id: faker.random.uuid(), // id: faker.random.uuid(),
created_at: faker.date.past(), // created_at: faker.date.past(),
type: 'Points', // type: 'Points',
amount: faker.commerce.price() // amount: faker.commerce.price()
}, // },
]; // ];
const data = this.props.appstate.transaction.list;
const columns = [{ const columns = [{
title: 'Id', title: 'Id',

View File

@ -111,7 +111,7 @@ export default class Transaction {
@action @action
getAll() { getAll() {
this.isLoading = true; this.isLoading = true;
return this.http.get("transaction") return this.http.get("transactions")
.then(res => { .then(res => {
this.list = res; this.list = res;
this.isLoading = false; this.isLoading = false;