inisiasi api location
This commit is contained in:
@@ -18,20 +18,6 @@ public function index(Request $request)
|
|||||||
Log::info('Query Params:', $request->query());
|
Log::info('Query Params:', $request->query());
|
||||||
Log::info('Gate Param:', [$request->query('gate')]);
|
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();
|
$getLocation = SoftSettings::first();
|
||||||
@@ -45,6 +31,23 @@ public function index(Request $request)
|
|||||||
'merchantID' => $getLocation->cabang_lokasi,
|
'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) {
|
if($query) {
|
||||||
$getPos = NamaPos::where('id', $request->query('gate'))->with('posParams','posHardware')->first();
|
$getPos = NamaPos::where('id', $request->query('gate'))->with('posParams','posHardware')->first();
|
||||||
$location['gateDetails'] = $getPos;
|
$location['gateDetails'] = $getPos;
|
||||||
|
|||||||
Reference in New Issue
Block a user