Fix board acl type

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2017-04-22 21:32:35 +02:00
parent 02eecb3a3f
commit 74c8a6e848

View File

@@ -104,23 +104,23 @@ app.factory('BoardService', function(ApiService, $http, $q){
} }
}; };
BoardService.prototype.addAcl = function(acl) { BoardService.prototype.addAcl = function (acl) {
var board = this.getCurrent(); var board = this.getCurrent();
var deferred = $q.defer(); var deferred = $q.defer();
var self = this; var self = this;
var _acl = acl; var _acl = acl;
$http.post(this.baseUrl + '/' + acl.boardId + '/acl', _acl).then(function (response) { $http.post(this.baseUrl + '/' + acl.boardId + '/acl', _acl).then(function (response) {
if(!board.acl || board.acl.length === 0) { if (!board.acl || board.acl.length === 0) {
board.acl = {}; board.acl = {};
} }
board.acl[response.data.id] = response.data; board.acl[response.data.id] = response.data;
deferred.resolve(response.data); deferred.resolve(response.data);
}, function (error) { }, function (error) {
deferred.reject('Error creating ACL ' + _acl); deferred.reject('Error creating ACL ' + _acl);
}); });
acl = null; acl = null;
return deferred.promise; return deferred.promise;
}; };
BoardService.prototype.deleteAcl = function(acl) { BoardService.prototype.deleteAcl = function(acl) {
var board = this.getCurrent(); var board = this.getCurrent();