mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
feat: Add make admin button to debug menu
This commit is contained in:
@@ -124,5 +124,9 @@ function($scope, $rootScope, User, $http, Notification, ApiUrl, Social) {
|
||||
'party.quest.progress.up': User.user.party.quest.progress.up + 1000
|
||||
});
|
||||
};
|
||||
|
||||
$scope.makeAdmin = function () {
|
||||
User.makeAdmin();
|
||||
};
|
||||
}
|
||||
}])
|
||||
|
||||
@@ -259,6 +259,20 @@ angular.module('habitrpg')
|
||||
});
|
||||
},
|
||||
|
||||
makeAdmin: function () {
|
||||
$http({
|
||||
method: "POST",
|
||||
url: 'api/v3/debug/update-user',
|
||||
data: {
|
||||
'contributor.admin': true
|
||||
}
|
||||
})
|
||||
.then(function (response) {
|
||||
Notification.text('You are now an admin! Go to the Hall of Heroes to change your contributor level.');
|
||||
sync()
|
||||
});
|
||||
},
|
||||
|
||||
clearNewMessages: function () {
|
||||
callOpsFunctionAndRequest('markPmsRead', 'mark-pms-read', "POST");
|
||||
},
|
||||
|
||||
@@ -92,6 +92,7 @@ footer.footer(ng-controller='FooterCtrl')
|
||||
a.btn.btn-default(ng-click='addLevelsAndGold()') +Exp +GP +MP
|
||||
a.btn.btn-default(ng-click='addOneLevel()') +1 Level
|
||||
a.btn.btn-default(ng-click='addBossQuestProgressUp()') +1000 Boss Quest Progress Up
|
||||
a.btn.btn-default(ng-click='makeAdmin()') Make Admin
|
||||
|
||||
div(ng-init='deferredScripts()')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user