aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2020-12-04 00:06:29 +0100
committerMateja <mail@matejamaric.com>2020-12-04 00:06:29 +0100
commit36945006257bc3ad65bd564ea6c40b40c0d0002a (patch)
tree552953409f12fdb7342858b267ebba3e8f6fe600 /app
parent368365d568f9410c85e41f8cc0bc0067ccf9635d (diff)
downloadyota-laravel-1.0.2.tar.gz
yota-laravel-1.0.2.zip
Fix Restore button.v1.0.2
Diffstat (limited to 'app')
-rw-r--r--app/Http/Controllers/ReservationsController.php26
1 files changed, 15 insertions, 11 deletions
diff --git a/app/Http/Controllers/ReservationsController.php b/app/Http/Controllers/ReservationsController.php
index c0b7121..002645a 100644
--- a/app/Http/Controllers/ReservationsController.php
+++ b/app/Http/Controllers/ReservationsController.php
@@ -205,23 +205,27 @@ class ReservationsController extends Controller
$rules = [
'action' => 'required',
'id' => 'required|numeric',
- 'qso' => 'required|numeric',
- 'approved' => 'required',
- 'specialCall' => 'required|alphanum',
- 'fromTime' => 'required|date',
- 'toTime' => 'required|date|after:fromTime',
- 'frequencies' => 'required',
- 'modes' => 'required',
- 'operatorCall' => 'required|alphanum',
- 'operatorName' => 'required',
- 'operatorEmail' => 'required|email',
- 'operatorPhone' => ['required', 'regex:/^[0-9 ]+$/'],
];
$validatedData = $request->validate($rules);
$record = Reservation::findOrFail($request->id);
if ($request->action == "update") {
+ $rules = [
+ 'qso' => 'required|numeric',
+ 'approved' => 'required',
+ 'specialCall' => 'required|alphanum',
+ 'fromTime' => 'required|date',
+ 'toTime' => 'required|date|after:fromTime',
+ 'frequencies' => 'required',
+ 'modes' => 'required',
+ 'operatorCall' => 'required|alphanum',
+ 'operatorName' => 'required',
+ 'operatorEmail' => 'required|email',
+ 'operatorPhone' => ['required', 'regex:/^[0-9 ]+$/'],
+ ];
+ $validatedData = $request->validate($rules);
+
$record->approved = filter_var($request->approved, FILTER_VALIDATE_BOOLEAN);
$record->qso = $request->qso;
$record->specialCall = $request->specialCall;