Ported User Serivce to client side and to api v3

This commit is contained in:
Keith Holliday
2016-05-05 13:02:56 -05:00
parent 9146e4601e
commit b037ddd14c
16 changed files with 474 additions and 331 deletions

View File

@@ -78,6 +78,7 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl, Social) {
});
};
//@TODO: Route?
$scope.addMissedDay = function(numberOfDays){
if (!confirm("Are you sure you want to reset the day by " + numberOfDays + " day(s)?")) return;
var dayBefore = moment(User.user.lastCron).subtract(numberOfDays, 'days').toDate();
@@ -86,15 +87,12 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl, Social) {
};
$scope.addTenGems = function(){
$http.post(ApiUrl.get() + '/api/v2/user/addTenGems').success(function(){
User.log({});
})
User.addTenGems();
};
$scope.addHourglass = function(){
$http.post(ApiUrl.get() + '/api/v2/user/addHourglass').success(function(){
User.log({});
})
User.addHourglass();
//User.log({});
};
$scope.addGold = function(){
@@ -124,6 +122,7 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl, Social) {
};
$scope.addBossQuestProgressUp = function(){
//@TODO: Route?
User.set({
'party.quest.progress.up': User.user.party.quest.progress.up + 1000
});