mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
Ported User Serivce to client side and to api v3
This commit is contained in:
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user