Show creditor in modal
This commit is contained in:
@@ -253,8 +253,8 @@ transactionControllers.controller('DetailsModalCtrl', [ '$scope', '$resource', '
|
||||
transaction = Transaction.get({ id: transactionId });
|
||||
transaction.$promise.then(function(data) {
|
||||
transaction.date = new Date(transaction.date);
|
||||
transaction.category = $resource(transaction._links.category.href).get();
|
||||
transaction.creditor = $resource(transaction._links.creditor.href).get();
|
||||
transaction.category = $resource(transaction._links.category.href).get();
|
||||
|
||||
transaction.category.$promise.then(function(data) {
|
||||
$scope.transaction = transaction;
|
||||
@@ -266,6 +266,15 @@ transactionControllers.controller('DetailsModalCtrl', [ '$scope', '$resource', '
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME can't wait for the promise since most transactions return HTTP 404 for the creditor
|
||||
if (transaction.creditor.name != undefined) {
|
||||
$scope.transaction.creditor = $scope.transaction.creditor._links.user.href;
|
||||
console.log('creditor: ' + transaction.creditor.name);
|
||||
}
|
||||
else {
|
||||
$scope.transaction.creditor = "";
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user