mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-22 03:34:14 +00:00
feat: Add make admin button to debug menu
This commit is contained in:
parent
bc58bd97bb
commit
50d7345832
3 changed files with 19 additions and 0 deletions
|
|
@ -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()')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue