Patch up the token delete button with the route

This commit is contained in:
Johannes Zellner
2016-06-07 15:38:42 +02:00
parent 290ab6cc7d
commit 8144c6d086
3 changed files with 16 additions and 1 deletions

View File

@@ -570,6 +570,13 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
}).error(defaultErrorHandler(callback));
};
Client.prototype.delToken = function (clientId, tokenId, callback) {
$http.delete(client.apiOrigin + '/api/v1/oauth/clients/' + clientId + '/tokens/' + tokenId).success(function(data, status) {
if (status !== 204) return callback(new ClientError(status, data));
callback(null);
}).error(defaultErrorHandler(callback));
};
Client.prototype.update = function (password, callback) {
$http.post(client.apiOrigin + '/api/v1/cloudron/update', { password: password }).success(function(data, status) {
if (status !== 202 || typeof data !== 'object') return callback(new ClientError(status, data));