Card: Show assigned users on board
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
Julius Härtl
parent
02ec4ae9d1
commit
99c31d3c00
@@ -160,12 +160,16 @@ app.controller('CardController', function ($scope, $rootScope, $routeParams, $lo
|
||||
};
|
||||
|
||||
$scope.addAssignedUser = function(item) {
|
||||
CardService.assignUser(CardService.getCurrent(), item.uid);
|
||||
CardService.assignUser(CardService.getCurrent(), item.uid).then(function (data) {
|
||||
StackService.updateCard(CardService.getCurrent());
|
||||
});
|
||||
$scope.status.showAssignUser = false;
|
||||
};
|
||||
|
||||
$scope.removeAssignedUser = function(item) {
|
||||
CardService.unassignUser(CardService.getCurrent(), item.participant.uid);
|
||||
CardService.unassignUser(CardService.getCurrent(), item.participant.uid).then(function (data) {
|
||||
StackService.updateCard(CardService.getCurrent());
|
||||
});
|
||||
};
|
||||
|
||||
});
|
||||
@@ -98,6 +98,8 @@ app.factory('CardService', function(ApiService, $http, $q){
|
||||
CardService.prototype.assignUser = function (card, user) {
|
||||
var deferred = $q.defer();
|
||||
var self = this;
|
||||
if (self.getCurrent().assignedUsers === null)
|
||||
self.getCurrent().assignedUsers = [];
|
||||
$http.post(this.baseUrl + '/' + card.id + '/assign', {'userId': user}).then(function (response) {
|
||||
self.getCurrent().assignedUsers.push(response.data);
|
||||
deferred.resolve(response.data);
|
||||
|
||||
Reference in New Issue
Block a user