feat: Add make admin button to debug menu

This commit is contained in:
Blade Barringer
2016-05-14 22:37:26 -05:00
parent bc58bd97bb
commit 50d7345832
3 changed files with 19 additions and 0 deletions

View File

@@ -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();
};
}
}])

View File

@@ -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");
},

View File

@@ -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()')