Fix account save.
This commit is contained in:
parent
729a061d02
commit
94f5b53206
@ -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;
|
||||
});
|
||||
};
|
||||
|
@ -70,7 +70,7 @@
|
||||
|
||||
<td>
|
||||
<form editable-form name="rowform"
|
||||
onbeforesave="save($data, $index)" shown="!account.id">
|
||||
onaftersave="save(account)" shown="!account.id">
|
||||
<div class="btn-group btn-group-xs">
|
||||
<!-- Edit account. -->
|
||||
<button type="button" class="btn btn-success"
|
||||
|
Loading…
Reference in New Issue
Block a user