🚀 feat(form): simplify validation for check property in ApplicationForm and add alert for agreement in profile view.

This commit is contained in:
fsociety
2024-10-26 19:40:56 +02:00
parent f05105770e
commit 65688f649e
2 changed files with 5 additions and 2 deletions

View File

@@ -9,6 +9,6 @@ class ApplicationForm extends Form
{
#[Validate('nullable|string')]
public $reason = '';
#[Validate('boolean|in:true')]
#[Validate('boolean')]
public $check = false;
}

View File

@@ -172,6 +172,10 @@ $listenForPayment = function () {
$save = function ($type) {
$this->form->validate();
if (!$this->form->check) {
$this->js('alert("Du musst den Statuten zustimmen.")');
return;
}
$this->currentPleb
->update([
@@ -322,7 +326,6 @@ $loadEvents = function () {
<div class="p-6 space-y-6">
<h2 class="sm:text-2xl text-[#1B1B1B] dark:text-gray-100 font-bold mb-5">Aktueller Status</h2>
<!-- Picture -->
<section>
<div class="flex flex-wrap space-y-2 sm:space-y-0 items-center justify-between">
<x-button label="Mit Nostr verbinden" @click="openNostrLogin"