diff --git a/src/components/Tx.js b/src/components/Tx.js index e620214..1ac2332 100644 --- a/src/components/Tx.js +++ b/src/components/Tx.js @@ -64,7 +64,7 @@ class Tx extends React.Component { return (
  • Edit - {tx.date} {tx.amount} {tx.currency} + {tx.date} {tx.amount} {tx.currency}
    {tx.note}
  • ) } @@ -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");