Add empty default value to description parameter and remove the tabs from the empty lines

Signed-off-by: alexandru.puiu <alexandrup@newro.co>
This commit is contained in:
alexandru.puiu
2019-08-19 11:38:04 +03:00
parent 313ceb9a95
commit 002587523f
2 changed files with 6 additions and 6 deletions

View File

@@ -76,7 +76,7 @@ class CardApiController extends ApiController {
* *
* Get a specific card. * Get a specific card.
*/ */
public function create($title, $type = 'plain', $order = 999, $description) { public function create($title, $type = 'plain', $order = 999, $description = '') {
$card = $this->cardService->create($title, $this->request->getParam('stackId'), $type, $order, $this->userId, $description); $card = $this->cardService->create($title, $this->request->getParam('stackId'), $type, $order, $this->userId, $description);
return new DataResponse($card, HTTP::STATUS_OK); return new DataResponse($card, HTTP::STATUS_OK);
} }

View File

@@ -315,7 +315,7 @@ class CardService {
// Trigger update events before setting description as it is handled separately // Trigger update events before setting description as it is handled separately
$changes->setAfter($card); $changes->setAfter($card);
$this->activityManager->triggerUpdateEvents(ActivityManager::DECK_OBJECT_CARD, $changes, ActivityManager::SUBJECT_CARD_UPDATE); $this->activityManager->triggerUpdateEvents(ActivityManager::DECK_OBJECT_CARD, $changes, ActivityManager::SUBJECT_CARD_UPDATE);
if ($card->getDescriptionPrev() === null) { if ($card->getDescriptionPrev() === null) {
$card->setDescriptionPrev($card->getDescription()); $card->setDescriptionPrev($card->getDescription());
} }
@@ -324,7 +324,7 @@ class CardService {
$card = $this->cardMapper->update($card); $card = $this->cardMapper->update($card);
$this->changeHelper->cardChanged($card->getId(), true); $this->changeHelper->cardChanged($card->getId(), true);
$this->eventDispatcher->dispatch( $this->eventDispatcher->dispatch(
'\OCA\Deck\Card::onUpdate', new GenericEvent(null, ['id' => $id, 'card' => $card]) '\OCA\Deck\Card::onUpdate', new GenericEvent(null, ['id' => $id, 'card' => $card])
); );
@@ -440,7 +440,7 @@ class CardService {
if (is_numeric($id) === false) { if (is_numeric($id) === false) {
throw new BadRequestException('id must be a number'); throw new BadRequestException('id must be a number');
} }
$this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT); $this->permissionService->checkPermission($this->cardMapper, $id, Acl::PERMISSION_EDIT);
if ($this->boardService->isArchived($this->cardMapper, $id)) { if ($this->boardService->isArchived($this->cardMapper, $id)) {
throw new StatusException('Operation not allowed. This board is archived.'); throw new StatusException('Operation not allowed. This board is archived.');
@@ -505,7 +505,7 @@ class CardService {
if (is_numeric($cardId) === false) { if (is_numeric($cardId) === false) {
throw new BadRequestException('card id must be a number'); throw new BadRequestException('card id must be a number');
} }
if (is_numeric($labelId) === false) { if (is_numeric($labelId) === false) {
throw new BadRequestException('label id must be a number'); throw new BadRequestException('label id must be a number');
} }
@@ -597,7 +597,7 @@ class CardService {
/* Notifyuser about the card assignment */ /* Notifyuser about the card assignment */
$this->notificationHelper->sendCardAssigned($card, $userId); $this->notificationHelper->sendCardAssigned($card, $userId);
} }
$assignment = new AssignedUsers(); $assignment = new AssignedUsers();
$assignment->setCardId($cardId); $assignment->setCardId($cardId);
$assignment->setParticipant($userId); $assignment->setParticipant($userId);