From 0c006d961bd62e797d579ab36d3dd7bc8f0a14a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 14 Mar 2024 15:57:50 +0100 Subject: [PATCH] Refactor RequiredClientInfo component to handle empty fields and source query parameter --- app/Livewire/RequiredClientInfo.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Livewire/RequiredClientInfo.php b/app/Livewire/RequiredClientInfo.php index 80e2654fdc..3c2d9f2145 100644 --- a/app/Livewire/RequiredClientInfo.php +++ b/app/Livewire/RequiredClientInfo.php @@ -165,9 +165,18 @@ class RequiredClientInfo extends Component ? $this->checkFields() : $this->show_form = false; + if (count($this->fields) === 0) { + $this->show_form = false; + + $this->dispatch( + 'passed-required-fields-check', + client_postal_code: $this->contact->client->postal_code + ); + } + if (request()->query('source') === 'subscriptions') { $this->show_form = false; - + $this->dispatch( 'passed-required-fields-check', client_postal_code: $this->contact->client->postal_code