mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
API: allow delete location by id (#14334)
* API: allow delete location by id Otherwise impossible to delete location "". * docs/API: location can be name or id for edit and delete
This commit is contained in:
@@ -2855,7 +2855,7 @@ function del_location(Illuminate\Http\Request $request)
|
||||
if (empty($location)) {
|
||||
return api_error(400, 'No location has been provided to delete');
|
||||
}
|
||||
$location_id = get_location_id_by_name($location);
|
||||
$location_id = ctype_digit($location) ? $location : get_location_id_by_name($location);
|
||||
if (empty($location_id)) {
|
||||
return api_error(400, "Failed to delete $location (Does not exists)");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user