tags creation added

This commit is contained in:
HolgerHatGarKeineNode
2023-03-17 13:41:03 +01:00
parent a366b0dd4c
commit 7fda007c1a

View File

@@ -63,7 +63,7 @@ class NewsArticleForm extends Component
if ($this->type === 'paid') {
$this->paid = true;
}
if ($this->libraryItem === null) {
if (!$this->libraryItem) {
$this->libraryItem = new LibraryItem([
'type' => 'markdown_article',
'value' => '',
@@ -75,6 +75,12 @@ class NewsArticleForm extends Component
'approved' => false,
]);
$this->selectedTags[] = 'News';
} else {
$this->selectedTags = $this->libraryItem->tags()
->where('type', 'library_item')
->get()
->map(fn($tag) => $tag->name)
->toArray();
}
if (!$this->fromUrl) {
$this->fromUrl = url()->previous();