Update update hook

This commit is contained in:
philipp lang 2024-10-20 21:40:16 +02:00
parent e67af9e33a
commit 0915de8f8b
2 changed files with 3 additions and 5 deletions

View File

@ -42,16 +42,14 @@ class Form extends Component
];
}
public function mount(?string $model = null): void
public function mount(?Mailgateway $model = null): void
{
$this->types = app('mail-gateways')->map(fn ($gateway) => [
'name' => $gateway::name(),
'id' => $gateway,
]);
$model = Mailgateway::find($model);
if ($model) {
if ($model->getRouteKey()) {
$this->id = $model->id;
$this->name = $model->name;
$this->domain = $model->domain;

View File

@ -9,7 +9,7 @@
<th>Aktion</th>
</thead>
<x-ui::action wire:click.prevent="$dispatch('openModal', {component: 'modules.mailgateway.components.form', props: {model: ''}, title: 'Verbindung erstellen'})" icon="plus" variant="danger">Neu</x-ui::action>
<x-ui::action wire:click.prevent="$dispatch('openModal', {component: 'modules.mailgateway.components.form', props: {}, title: 'Verbindung erstellen'})" icon="plus" variant="danger">Neu</x-ui::action>
@foreach ($data as $index => $gateway)
<tr wire:key="$index">