Fix account save.
This commit is contained in:
parent
729a061d02
commit
94f5b53206
@ -119,14 +119,16 @@ angular.module('accountant.accounts', [
|
|||||||
/*
|
/*
|
||||||
* Save account.
|
* Save account.
|
||||||
*/
|
*/
|
||||||
$scope.save = function($data, $index) {
|
$scope.save = function(account) {
|
||||||
var account = $scope.accounts[$index];
|
//var account = $scope.accounts[$index];
|
||||||
|
|
||||||
account = angular.merge(account, $data);
|
//account = angular.merge(account, $data);
|
||||||
|
|
||||||
return account.$save().then(function(data) {
|
return account.$save().then(function(data) {
|
||||||
Notification.success('Account #' + data.id + ' saved.');
|
Notification.success('Account #' + data.id + ' saved.');
|
||||||
|
|
||||||
|
// TODO Alexis Lahouze 2016-03-08 Update solds
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
<td>
|
<td>
|
||||||
<form editable-form name="rowform"
|
<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">
|
<div class="btn-group btn-group-xs">
|
||||||
<!-- Edit account. -->
|
<!-- Edit account. -->
|
||||||
<button type="button" class="btn btn-success"
|
<button type="button" class="btn btn-success"
|
||||||
|
Loading…
Reference in New Issue
Block a user