mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +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){
|
||||
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});
|
||||
Notification.text('-' + numberOfDays + ' day(s), remember to refresh');
|
||||
|
||||
User.setCron(numberOfDays);
|
||||
};
|
||||
|
||||
$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 () {
|
||||
callOpsFunctionAndRequest('markPmsRead', 'mark-pms-read', "POST");
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user