Merge branch '653-modify-message-when-no-hubs-are-found' into 'master'

Resolve "Modify message when no hubs are found"

Closes #653

See merge request jankstudio/resq!765
This commit is contained in:
Kendrick Chan 2022-03-24 08:10:57 +00:00
commit f9647f3337

View file

@ -2675,7 +2675,7 @@ class APIController extends Controller implements LoggedController
if (empty($nearest_hub_slots['hub']))
{
$res->setError(true)
->setErrorMessage('Thank you for reaching out to us. Due to the General Community Quarantine, our Operations are from 8AM to 6PM only. Please expect a call from us tomorrow and we will assist you with your request. Thank you and stay safe!');
->setErrorMessage('Thank you for reaching out to us. Please expect a call from us and we will assist you with your request. Thank you and stay safe!');
return $res->getReturnResponse();
}
}
@ -2687,7 +2687,7 @@ class APIController extends Controller implements LoggedController
if (empty($nearest_hub_slots['hub']))
{
$res->setError(true)
->setErrorMessage('Thank you for reaching out to us. Due to the General Community Quarantine, our Operations are from 8AM to 6PM only. Please expect a call from us tomorrow and we will assist you with your request. Thank you and stay safe!');
->setErrorMessage('Thank you for reaching out to us. Please expect a call from us and we will assist you with your request. Thank you and stay safe!');
return $res->getReturnResponse();
}
}
@ -4365,11 +4365,14 @@ class APIController extends Controller implements LoggedController
}
}
// set hub data to what is in nearest
$hub_data = [
'hub' => $nearest['hub'],
'slots' => $hub_slots['slot_data'],
];
if ($nearest != null)
{
// set hub data to what is in nearest
$hub_data = [
'hub' => $nearest['hub'],
'slots' => $hub_slots['slot_data'],
];
}
return $hub_data;