Fix issues found while testing. #651

This commit is contained in:
Korina Cordero 2022-03-24 05:38:18 +00:00
parent 457bbece2b
commit e80ce9db66

View file

@ -4336,7 +4336,16 @@ class APIController extends Controller implements LoggedController
foreach ($nearest_hubs_with_distance as $nhd)
{
if (empty($nearest))
{
// get the slots for the hub to check if hub is available for assignment
$hub_slots = $this->getHubRiderSlots($nhd['hub'], $em);
$flag_hub_available = $hub_slots['flag_hub_available'];
if ($flag_hub_available == true)
{
$nearest = $nhd;
}
}
else
{
if ($nhd['distance'] < $nearest['distance'])