sipp11 9 years ago
parent
commit
d88fa2947a
  1. 13
      src/components/Tx.js

13
src/components/Tx.js

@ -64,7 +64,7 @@ class Tx extends React.Component {
return (
<li key={tx.id}>
<a onClick={this.changeTx.bind(this, tx)} className="pull-left hollow tiny button">Edit</a>
{tx.date} <b>{tx.amount} {tx.currency}</b>
{tx.date} <b>{tx.amount} {tx.currency} <br/><small>{tx.note}</small></b>
</li>
)
}
@ -76,17 +76,16 @@ class Tx extends React.Component {
.newTx(tx)
.catch(function(err) {
alert("Error creating tx");
console.log("Error updating tx ", err);
console.log("Error creating tx ", err);
});
}
updateTx(tx) {
tx.user = this.props.user.user_id;
if (!tx.id) {
delete tx['id'];
TxService.newTx(tx);
}
TxService
if (!tx.id)
return this.newTx(tx)
return TxService
.updateTx(tx)
.catch(function(err) {
alert("Error updating");

Loading…
Cancel
Save