mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-14 07:27:47 +00:00
fix(#58): fix validation rule for recipes
This commit is contained in:
parent
a72e39e0ec
commit
f5d5cb4aef
1 changed files with 2 additions and 3 deletions
|
|
@ -92,7 +92,7 @@ new class extends Component {
|
||||||
'polling_body' => 'nullable|string',
|
'polling_body' => 'nullable|string',
|
||||||
'data_payload' => 'required_if:data_strategy,static|nullable|json',
|
'data_payload' => 'required_if:data_strategy,static|nullable|json',
|
||||||
'markup_code' => 'nullable|string',
|
'markup_code' => 'nullable|string',
|
||||||
'markup_language' => 'required|string|in:blade,liquid',
|
'markup_language' => 'nullable|string|in:blade,liquid',
|
||||||
'checked_devices' => 'array',
|
'checked_devices' => 'array',
|
||||||
'playlist_name' => 'required_if:selected_playlist,new|string|max:255',
|
'playlist_name' => 'required_if:selected_playlist,new|string|max:255',
|
||||||
'selected_weekdays' => 'nullable|array',
|
'selected_weekdays' => 'nullable|array',
|
||||||
|
|
@ -105,8 +105,7 @@ new class extends Component {
|
||||||
{
|
{
|
||||||
abort_unless(auth()->user()->plugins->contains($this->plugin), 403);
|
abort_unless(auth()->user()->plugins->contains($this->plugin), 403);
|
||||||
$validated = $this->validate();
|
$validated = $this->validate();
|
||||||
$validated['data_payload'] = json_decode($validated['data_payload'], true);
|
$validated['data_payload'] = json_decode(Arr::get($validated,'data_payload'), true);
|
||||||
|
|
||||||
$this->plugin->update($validated);
|
$this->plugin->update($validated);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue