Tavern party challenges invites fix (#7394)

* Added challenges and invitations to party

* Loaded tavern challenges

* Updated group and quest services tests
This commit is contained in:
Keith Holliday
2016-05-21 16:26:34 +01:00
committed by Matteo Pagliazzi
parent a210542e0a
commit b378e41f2c
4 changed files with 21 additions and 3 deletions

View File

@@ -1,10 +1,14 @@
'use strict';
habitrpg.controller("TavernCtrl", ['$scope', 'Groups', 'User',
function($scope, Groups, User) {
habitrpg.controller("TavernCtrl", ['$scope', 'Groups', 'User', 'Challenges',
function($scope, Groups, User, Challenges) {
Groups.tavern()
.then(function (tavern) {
$scope.group = tavern;
Challenges.getGroupChallenges($scope.group._id)
.then(function (response) {
$scope.group.challenges = response.data.data;
});
})
$scope.toggleUserTier = function($event) {

View File

@@ -121,8 +121,16 @@ angular.module('habitrpg')
Members.getGroupMembers(data.party._id, true)
.then(function (response) {
data.party.members = response.data.data;
_cachedPartyPromise.resolve(data.party);
});
Members.getGroupInvites(data.party._id)
.then(function (response) {
data.party.invites = response.data.data;
});
Challenges.getGroupChallenges(data.party._id)
.then(function (response) {
data.party.challenges = response.data.data;
});
_cachedPartyPromise.resolve(data.party);
}, function (response) {
data.party = { type: 'party' };
_cachedPartyPromise.reject(data.party);