angular requires special treatment for DELETE

This commit is contained in:
Johannes Zellner
2016-02-10 17:12:58 +01:00
parent 94bd0c606b
commit 820e417026
3 changed files with 19 additions and 1 deletions

View File

@@ -417,6 +417,17 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
}).error(defaultErrorHandler(callback));
};
Client.prototype.removeGroup = function (groupId, password, callback) {
var data = {
password: password
};
$http({ method: 'DELETE', url: client.apiOrigin + '/api/v1/groups/' + groupId, data: data, headers: { 'Content-Type': 'application/json' }}).success(function(data, status) {
if (status !== 204) return callback(new ClientError(status, data));
callback(null, data);
}).error(defaultErrorHandler(callback));
};
Client.prototype.getNonApprovedApps = function (callback) {
if (!this._config.developerMode) return callback(null, []);