Commit 42e7ef990649083904738128f4f1068418efc5e6
1 parent
37d4476a
Exists in
master
and in
38 other branches
Fix boxes endpoint
Showing
3 changed files
with
8 additions
and
2 deletions
Show diff stats
src/app/components/noosfero/noosfero.service.js
| ... | ... | @@ -3,7 +3,10 @@ |
| 3 | 3 | |
| 4 | 4 | angular.module('angular').factory('noosfero', function(Restangular) { |
| 5 | 5 | return { |
| 6 | - communities: Restangular.service('communities') | |
| 6 | + communities: Restangular.service('communities'), | |
| 7 | + boxes: function(profileId) { | |
| 8 | + return Restangular.service('boxes', Restangular.one('profiles', profileId)) | |
| 9 | + } | |
| 7 | 10 | } |
| 8 | 11 | }); |
| 9 | 12 | })(); | ... | ... |
src/app/profile/profile.controller.js
| ... | ... | @@ -15,6 +15,9 @@ |
| 15 | 15 | function activate() { |
| 16 | 16 | noosfero.communities.one().get({identifier: $stateParams.profile}).then(function(communities) { |
| 17 | 17 | vm.owner = communities.communities[0]; |
| 18 | + return noosfero.boxes(vm.owner.id).one().get(); | |
| 19 | + }).then(function(response) { | |
| 20 | + vm.boxes = response.boxes; | |
| 18 | 21 | }); |
| 19 | 22 | } |
| 20 | 23 | ... | ... |
src/app/profile/profile.html
| 1 | 1 | <div class="profile-container"> |
| 2 | 2 | <div class="row"> |
| 3 | - <ng-include ng-repeat="box in vm.owner.boxes | orderBy: vm.boxesOrder" src="'app/views/profile/box.html'"></ng-include> | |
| 3 | + <ng-include ng-repeat="box in vm.boxes | orderBy: vm.boxesOrder" src="'app/views/profile/box.html'"></ng-include> | |
| 4 | 4 | </div> |
| 5 | 5 | </div> | ... | ... |