mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
challenges: GET /groups now returns a merged array of groups, rather
than structured object of {public,guilds,party,tavern}. I was having
trouble with ngResource without doing this, @paglias let me know what
you think
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notification', '$compile', 'Groups', '$state',
|
||||
function($scope, User, Challenges, Notification, $compile, Groups, $state) {
|
||||
habitrpg.controller("ChallengesCtrl", ['$scope', 'User', 'Challenges', 'Notification', '$compile', 'Groups', '$state', 'API_URL', '$http',
|
||||
function($scope, User, Challenges, Notification, $compile, Groups, $state, API_URL, $http) {
|
||||
|
||||
// FIXME get this from cache
|
||||
Groups.Group.query(function(groups){
|
||||
groups.tavern[0].name = 'Tavern';
|
||||
$scope.groups = groups.party.concat(groups.guilds).concat(groups.tavern);
|
||||
Groups.Group.query({type:'party,guilds,tavern'}, function(groups){
|
||||
$scope.groups = groups;
|
||||
$scope.search = {
|
||||
group: _.reduce($scope.groups, function(m,g){m[g._id]=true;return m;}, {})
|
||||
group: _.reduce(groups, function(m,g){m[g._id]=true;return m;}, {})
|
||||
};
|
||||
});
|
||||
// FIXME $scope.challenges needs to be resolved first (see app.js)
|
||||
|
||||
Reference in New Issue
Block a user