Update update hook

This commit is contained in:
philipp lang 2024-10-20 21:40:16 +02:00
parent 21433624c5
commit b26ac83031
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) => [ $this->types = app('mail-gateways')->map(fn ($gateway) => [
'name' => $gateway::name(), 'name' => $gateway::name(),
'id' => $gateway, 'id' => $gateway,
]); ]);
$model = Mailgateway::find($model); if ($model->getRouteKey()) {
if ($model) {
$this->id = $model->id; $this->id = $model->id;
$this->name = $model->name; $this->name = $model->name;
$this->domain = $model->domain; $this->domain = $model->domain;

View File

@ -9,7 +9,7 @@
<th>Aktion</th> <th>Aktion</th>
</thead> </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) @foreach ($data as $index => $gateway)
<tr wire:key="$index"> <tr wire:key="$index">