Merge branch '132-more-rider-api-calls' into 'master'

Resolve "More rider api calls"

Closes #132

See merge request jankstudio/resq!115
This commit is contained in:
Kendrick Chan 2018-05-28 09:02:32 +00:00
commit 8121517ab1

View file

@ -241,6 +241,29 @@ class RAPIController extends Controller
$em->flush();
$hub = $rider->getHub();
if ($hub == null)
$hub_data = null;
else
{
$coord = $hub->getCoordinates();
$hub_data = [
'id' => $hub->getID(),
'name' => $hub->getName(),
'branch' => $hub->getBranch(),
'longitude' => $coord->getLongitude(),
'latitude' => $coord->getLatitude(),
'contact_nums' => $hub->getContactNumbers(),
];
}
// data
$data = [
'hub' => $hub_data
];
$res->setData($data);
return $res->getReturnResponse();
}