mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-27 06:33:18 +00:00
🧹 Migrate Yarn registry URLs to npm registry: update yarn.lock dependencies for consistency and clean up unused entries.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Livewire\Forms;
|
||||
|
||||
use App\Enums\AssociationStatus;
|
||||
use App\Models\EinundzwanzigPleb;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Form;
|
||||
|
||||
@@ -10,6 +12,26 @@ class ApplicationForm extends Form
|
||||
#[Validate('nullable|string')]
|
||||
public $reason = '';
|
||||
|
||||
#[Validate('boolean')]
|
||||
#[Validate('accepted')]
|
||||
public $check = false;
|
||||
|
||||
public ?EinundzwanzigPleb $currentPleb = null;
|
||||
|
||||
public function setPleb(EinundzwanzigPleb $pleb): void
|
||||
{
|
||||
$this->currentPleb = $pleb;
|
||||
}
|
||||
|
||||
public function apply(AssociationStatus|int $status): void
|
||||
{
|
||||
$this->validate();
|
||||
|
||||
$status = $status instanceof AssociationStatus ? $status : AssociationStatus::from($status);
|
||||
|
||||
$this->currentPleb->update([
|
||||
'association_status' => $status,
|
||||
]);
|
||||
|
||||
$this->reset('check');
|
||||
}
|
||||
}
|
||||
|
||||
64
app/Livewire/Forms/ProfileForm.php
Normal file
64
app/Livewire/Forms/ProfileForm.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Forms;
|
||||
|
||||
use App\Models\EinundzwanzigPleb;
|
||||
use Flux\Flux;
|
||||
use Livewire\Attributes\Validate;
|
||||
use Livewire\Form;
|
||||
|
||||
class ProfileForm extends Form
|
||||
{
|
||||
#[Validate('nullable|email')]
|
||||
public ?string $email = '';
|
||||
|
||||
#[Validate('nullable|string|max:255|regex:/^[a-z0-9_-]+$/|unique:einundzwanzig_plebs,nip05_handle')]
|
||||
public ?string $nip05Handle = '';
|
||||
|
||||
public ?EinundzwanzigPleb $currentPleb;
|
||||
|
||||
public function setEmail(EinundzwanzigPleb $currentPleb): void
|
||||
{
|
||||
$this->currentPleb = $currentPleb;
|
||||
$this->email = $currentPleb->email;
|
||||
}
|
||||
|
||||
public function setNip05Handle(EinundzwanzigPleb $currentPleb): void
|
||||
{
|
||||
$this->currentPleb = $currentPleb;
|
||||
$this->nip05Handle = $currentPleb->nip05_handle;
|
||||
}
|
||||
|
||||
public function setPleb(EinundzwanzigPleb $currentPleb): void
|
||||
{
|
||||
$this->currentPleb = $currentPleb;
|
||||
$this->email = $currentPleb->email;
|
||||
$this->nip05Handle = $currentPleb->nip05_handle;
|
||||
}
|
||||
|
||||
public function saveEmail(): void
|
||||
{
|
||||
$this->validateOnly('email');
|
||||
|
||||
$this->currentPleb->update([
|
||||
'email' => $this->email,
|
||||
]);
|
||||
|
||||
Flux::toast('E-Mail Adresse gespeichert.');
|
||||
}
|
||||
|
||||
public function saveNip05Handle(): void
|
||||
{
|
||||
$this->validateOnly('nip05Handle');
|
||||
|
||||
$nip05Handle = $this->nip05Handle ? strtolower($this->nip05Handle) : null;
|
||||
|
||||
$this->currentPleb->update([
|
||||
'nip05_handle' => $nip05Handle,
|
||||
]);
|
||||
|
||||
$this->nip05Handle = $nip05Handle;
|
||||
|
||||
Flux::toast('NIP-05 Handle gespeichert.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user