Open sidebar
/api/loans/1/pendingvotes --------------------------------- { data: [ { user_id: "2", loan_id: "1", notification_type: "vote", task: "Tony Stark - Glass Towers", status: "pending" } ] } ================================== /api/loans/2/pendingvotes --------------------------------- { data: [ ] } ================================== LoansFactory.getLoans().then(function success(response){ var allLoans = response.data.data; $q.all( _.map(allLoans, function(obj){ //true if return LoansFactory.getPendingVotes(obj.id) .then(function(pvs){ if(pvs.data.length == 0){ obj.need_vote = false; } else { obj.need_vote = true; } // end if return obj; }) }) ).then(function(loans){ $scope.loans = loans; }) });
Close sidebar
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting