Fixes for skipping

This commit is contained in:
Benjamin Beganović 2024-03-15 01:58:17 +01:00
parent cc99ea0f71
commit e3e19208a4

View File

@ -231,15 +231,6 @@ class RequiredClientInfo extends Component
? $this->checkFields() ? $this->checkFields()
: $this->show_form = false; : $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') { if (request()->query('source') === 'subscriptions') {
$this->show_form = false; $this->show_form = false;
@ -406,6 +397,17 @@ $_contact->push();
} }
} }
} }
$left = collect($this->fields)
->filter(fn ($field) => !array_key_exists('filled', $field))
->count();
if ($left === 0) {
$this->dispatch(
'passed-required-fields-check',
client_postal_code: $this->contact->client->postal_code
);
}
} }
public function showCopyBillingCheckbox(): bool public function showCopyBillingCheckbox(): bool