mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix API get_location by ID (#15506)
This commit is contained in:
@@ -2914,7 +2914,7 @@ function get_location(Illuminate\Http\Request $request)
|
||||
if (empty($location)) {
|
||||
return api_error(400, 'No location has been provided to get');
|
||||
}
|
||||
$data = ctype_digit($location) ? Location::find($location_id) : Location::where('location', $location)->first();
|
||||
$data = ctype_digit($location) ? Location::find($location) : Location::where('location', $location)->first();
|
||||
if (empty($data)) {
|
||||
return api_error(404, 'Location does not exist');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user