Skip to content

Commit

Permalink
Favorite genre not working - 1.0.11 #290
Browse files Browse the repository at this point in the history
  • Loading branch information
dularion committed Feb 19, 2017
1 parent 55d5af2 commit 4b9fb24
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ angular.module('streama').controller('profileCtrl', function ($scope, apiService
});

$scope.toggleSelectGenre = function (genre) {
if(_.find($scope.user.favoriteGenres, {apiId: genre.apiId})){
_.remove($scope.user.favoriteGenres, {apiId: genre.apiId});
}else{
$scope.user.favoriteGenres.push(genre);
}
$scope.user.favoriteGenres = _.xorBy($scope.user.favoriteGenres, [genre], 'apiId');
$scope.profileForm.$setDirty();
};

$scope.isGenreSelected = function (genre) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h1>
</div>
<div class="col-sm-9">
<ul class="genre-list">
<li class="genre-tag" ng-class="{'active': isGenreSelected(genre)}" ng-repeat="genre in availableGenres" ng-click="toggleSelectGenre(genre)">
<li class="genre-tag" ng-class="{'active': isGenreSelected(genre)}" ng-repeat="genre in availableGenres | orderBy:'name'" ng-click="toggleSelectGenre(genre)">
{{genre.name}}
</li>
</ul>
Expand Down
3 changes: 2 additions & 1 deletion grails-app/controllers/streama/UserController.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ class UserController {
return [user: user]
}

respond status: UNAUTHORIZED
response.setStatus(UNAUTHORIZED.value())
render 'Not logged in'
}

@Transactional
Expand Down
2 changes: 1 addition & 1 deletion grails-app/views/user/current.gson
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ model {
User user
}

json g.render(user){
json g.render(user, [deep: true]){
authorities user.authorities?.collect{[id: it?.id]}
isAdmin (user?.authorities?.find{it.authority == 'ROLE_ADMIN'} ? true : false)
isContentManager (user?.authorities?.find{it.authority == 'ROLE_CONTENT_MANAGER'} ? true : false)
Expand Down

0 comments on commit 4b9fb24

Please sign in to comment.