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() {
this.props.appstate.transaction.getAll();
this.purchasedItemStore.getAll().then(res => {
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 points = <NumberFormat value={this.props.appstate.wallet.data.point} displayType={'text'} thousandSeparator={true}/>;
const data = [
{
id: faker.random.uuid(),
created_at: faker.date.past(),
type: 'Points',
amount: faker.commerce.price()
},
{
id: faker.random.uuid(),
created_at: faker.date.past(),
type: 'Points',
amount: faker.commerce.price()
},
{
id: faker.random.uuid(),
created_at: faker.date.past(),
type: 'Voucher',
amount: faker.commerce.price()
},
{
id: faker.random.uuid(),
created_at: faker.date.past(),
type: 'Voucher',
amount: faker.commerce.price()
},
{
id: faker.random.uuid(),
created_at: faker.date.past(),
type: 'Points',
amount: faker.commerce.price()
},
];
// const data = [
// {
// id: faker.random.uuid(),
// created_at: faker.date.past(),
// type: 'Points',
// amount: faker.commerce.price()
// },
// {
// id: faker.random.uuid(),
// created_at: faker.date.past(),
// type: 'Points',
// amount: faker.commerce.price()
// },
// {
// id: faker.random.uuid(),
// created_at: faker.date.past(),
// type: 'Voucher',
// amount: faker.commerce.price()
// },
// {
// id: faker.random.uuid(),
// created_at: faker.date.past(),
// type: 'Voucher',
// amount: faker.commerce.price()
// },
// {
// id: faker.random.uuid(),
// created_at: faker.date.past(),
// type: 'Points',
// amount: faker.commerce.price()
// },
// ];
const data = this.props.appstate.transaction.list;
const columns = [{
title: 'Id',

View File

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