From 94f5b5320691d36e03aaf4727984ce1ff26c660f Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Tue, 12 Apr 2016 10:46:08 +0200 Subject: [PATCH] Fix account save. --- accountant/frontend/static/js/accounts.js | 8 +++++--- accountant/frontend/static/views/accounts.html | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/accountant/frontend/static/js/accounts.js b/accountant/frontend/static/js/accounts.js index decfab8..eae3b57 100644 --- a/accountant/frontend/static/js/accounts.js +++ b/accountant/frontend/static/js/accounts.js @@ -119,14 +119,16 @@ angular.module('accountant.accounts', [ /* * Save account. */ - $scope.save = function($data, $index) { - var account = $scope.accounts[$index]; + $scope.save = function(account) { + //var account = $scope.accounts[$index]; - account = angular.merge(account, $data); + //account = angular.merge(account, $data); return account.$save().then(function(data) { Notification.success('Account #' + data.id + ' saved.'); + // TODO Alexis Lahouze 2016-03-08 Update solds + return data; }); }; diff --git a/accountant/frontend/static/views/accounts.html b/accountant/frontend/static/views/accounts.html index d5c7bc4..9920458 100644 --- a/accountant/frontend/static/views/accounts.html +++ b/accountant/frontend/static/views/accounts.html @@ -70,7 +70,7 @@
+ onaftersave="save(account)" shown="!account.id">