mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
fix: Correct set cron debug function
This commit is contained in:
@@ -78,12 +78,10 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl, Social) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
//@TODO: Route?
|
|
||||||
$scope.addMissedDay = function(numberOfDays){
|
$scope.addMissedDay = function(numberOfDays){
|
||||||
if (!confirm("Are you sure you want to reset the day by " + numberOfDays + " day(s)?")) return;
|
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();
|
|
||||||
User.set({'lastCron': dayBefore});
|
User.setCron(numberOfDays);
|
||||||
Notification.text('-' + numberOfDays + ' day(s), remember to refresh');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.addTenGems = function(){
|
$scope.addTenGems = function(){
|
||||||
|
|||||||
@@ -244,6 +244,21 @@ angular.module('habitrpg')
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setCron: function (numberOfDays) {
|
||||||
|
var date = moment(user.lastCron).subtract(numberOfDays, 'days').toDate();
|
||||||
|
|
||||||
|
$http({
|
||||||
|
method: "POST",
|
||||||
|
url: 'api/v3/debug/update-user',
|
||||||
|
data: {
|
||||||
|
lastCron: date
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(function (response) {
|
||||||
|
Notification.text('-' + numberOfDays + ' day(s), remember to refresh');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
clearNewMessages: function () {
|
clearNewMessages: function () {
|
||||||
callOpsFunctionAndRequest('markPmsRead', 'mark-pms-read', "POST");
|
callOpsFunctionAndRequest('markPmsRead', 'mark-pms-read', "POST");
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user