diff options
Diffstat (limited to 'app/Http')
-rw-r--r-- | app/Http/Controllers/ReservationsController.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/app/Http/Controllers/ReservationsController.php b/app/Http/Controllers/ReservationsController.php index 141dbc4..de1ea76 100644 --- a/app/Http/Controllers/ReservationsController.php +++ b/app/Http/Controllers/ReservationsController.php @@ -30,15 +30,27 @@ class ReservationsController extends Controller ]); if ($request->input('call-sign') == 'all') { - $activities = Reservation::where('approved', '1')->get(); - - return response()->json($activities); + $activities = Reservation::where('approved', '1') + ->select('operatorCall', 'fromTime', 'toTime', 'specialCall', 'frequencies', 'qso') + ->get()->toArray(); + $data = [ + 'status' => 'OK', + 'data' => $activities + ]; + + return response($data); } else { - $activities = Reservation::whereColumn('approved', '1') - ->whereColumn('specialCall', $request->input('call-sign')) - ->get(); - - return response()->json($activities); + $activities = Reservation::where('approved', '1') + ->select('operatorCall', 'fromTime', 'toTime', 'frequencies', 'qso') + ->where('specialCall', $request->input('call-sign')) + ->get() + ->toArray(); + $data = [ + 'status' => 'OK', + 'data' => $activities + ]; + + return response($data); } } else if ($request->isMethod('get')) { $signs = SpecialCall::all(); |