From d88fa2947a1618413c66c640d54eac80790c8d6b Mon Sep 17 00:00:00 2001 From: sipp11 Date: Wed, 16 Dec 2015 18:31:27 +0700 Subject: [PATCH] wip --- src/components/Tx.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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");