wrote attachment api controller, fixed bug caught by unit test in CardService
Signed-off-by: Ryan Fletcher <ryan.fletcher@codepassion.ca>
This commit is contained in:
committed by
Julius Härtl
parent
e88c9a760d
commit
37a2858d5f
@@ -356,6 +356,7 @@ class CardService {
|
||||
* @throws \OCA\Deck\NoPermissionException
|
||||
* @throws \OCP\AppFramework\Db\DoesNotExistException
|
||||
* @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException
|
||||
* @throws BadRequestException
|
||||
*/
|
||||
public function assignLabel($cardId, $labelId) {
|
||||
|
||||
@@ -421,8 +422,8 @@ class CardService {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
|
||||
if (is_numeric($userId) === false) {
|
||||
throw new BadRequestException('user id must be a number');
|
||||
if ($userId === false || $userId === null) {
|
||||
throw new BadRequestException('user id must be provided');
|
||||
}
|
||||
|
||||
$this->permissionService->checkPermission($this->cardMapper, $cardId, Acl::PERMISSION_EDIT);
|
||||
@@ -461,8 +462,8 @@ class CardService {
|
||||
throw new BadRequestException('card id must be a number');
|
||||
}
|
||||
|
||||
if (is_numeric($userId) === false) {
|
||||
throw new BadRequestException('user id must be a number');
|
||||
if ($userId === false || $userId === null) {
|
||||
throw new BadRequestException('user must be provided');
|
||||
}
|
||||
|
||||
$assignments = $this->assignedUsersMapper->find($cardId);
|
||||
|
||||
Reference in New Issue
Block a user