diff --git a/app/Http/Controllers/Api/V1/ConfigParameter.php b/app/Http/Controllers/Api/V1/ConfigParameter.php index 82f1025..e2e5a49 100644 --- a/app/Http/Controllers/Api/V1/ConfigParameter.php +++ b/app/Http/Controllers/Api/V1/ConfigParameter.php @@ -18,20 +18,6 @@ public function index(Request $request) Log::info('Query Params:', $request->query()); Log::info('Gate Param:', [$request->query('gate')]); - if (!array_key_exists('gate', $_GET)) { - return response()->json([ - 'status' => 'failed', - 'desc' => 'Parameter undefined', - ],400); - - } - - if ($query === '') { - return response()->json([ - 'status' => 'failed', - 'desc' => 'Parameter gate tidak boleh kosong', - ], 400); - } $getLocation = SoftSettings::first(); @@ -45,6 +31,23 @@ public function index(Request $request) 'merchantID' => $getLocation->cabang_lokasi, ]; + if (!array_key_exists('gate', $_GET)) { + return response()->json([ + 'status' => 'success', + // 'desc' => 'Parameter undefined', + 'details' => $location + ],400); + + } + + if ($query === '') { + return response()->json([ + 'status' => 'failed', + 'desc' => 'Parameter gate tidak boleh kosong', + ], 400); + } + + if($query) { $getPos = NamaPos::where('id', $request->query('gate'))->with('posParams','posHardware')->first(); $location['gateDetails'] = $getPos;