diff --git a/lib/Controller/CardController.php b/lib/Controller/CardController.php index c0e6d10c3..6328fb5cc 100644 --- a/lib/Controller/CardController.php +++ b/lib/Controller/CardController.php @@ -65,11 +65,11 @@ class CardController extends Controller { $card = $this->cardService->create($title, $stackId, $type, $order, $this->userId, $description, $duedate); foreach ($labels as $label) { - $this->assignLabel($card->id, $label); + $this->assignLabel($card->getId(), $label); } foreach ($users as $user) { - $this->assignmentService->assignUser($card->id, $user['id'], $user['type']); + $this->assignmentService->assignUser($card->getId(), $user['id'], $user['type']); } return $card; diff --git a/src/views/CreateNewCardCustomPicker.vue b/src/views/CreateNewCardCustomPicker.vue index 052e7e9e0..d23f6e81a 100644 --- a/src/views/CreateNewCardCustomPicker.vue +++ b/src/views/CreateNewCardCustomPicker.vue @@ -276,10 +276,11 @@ export default { } }, onSelectLabel(label) { + if (!label.id) return this.card.labels.push(label) }, onRemoveLabel(removedLabel) { - this.card.labels = this.card.label.filter(label => label.id !== removedLabel.id) + this.card.labels = this.card.labels.filter(label => label.id !== removedLabel.id) }, onSelectUser(user) { this.card.assignedUsers.push(user)