lnbits paid articles added

This commit is contained in:
HolgerHatGarKeineNode
2023-03-13 17:11:31 +01:00
parent cfd6156937
commit 07be5d9b0c
2 changed files with 8 additions and 2 deletions

View File

@@ -24,9 +24,12 @@ class NewsArticleForm extends Component
public array $temporaryUrls = []; public array $temporaryUrls = [];
public ?string $fromUrl = ''; public ?string $fromUrl = '';
public string $type = '';
public bool $paid = false; public bool $paid = false;
protected $queryString = ['fromUrl' => ['except' => ''], 'paid' => ['except' => false]]; protected $queryString = ['fromUrl' => ['except' => ''], 'type' => ['except' => '']];
public function rules() public function rules()
{ {
@@ -50,6 +53,9 @@ class NewsArticleForm extends Component
public function mount() public function mount()
{ {
if ($this->type === 'paid') {
$this->paid = true;
}
if ($this->libraryItem === null) { if ($this->libraryItem === null) {
$this->libraryItem = new LibraryItem([ $this->libraryItem = new LibraryItem([
'type' => 'markdown_article', 'type' => 'markdown_article',

View File

@@ -24,7 +24,7 @@
@if(auth()->user()->lnbits) @if(auth()->user()->lnbits)
<x-button <x-button
class="whitespace-nowrap" class="whitespace-nowrap"
:href="route('news.form', ['paid' => true])" :href="route('news.form', ['type' => 'paid'])"
primary> primary>
<i class="fa fa-thin fa-plus"></i> <i class="fa fa-thin fa-plus"></i>
{{ __('Submit paid news article') }} {{ __('Submit paid news article') }}