Return hub data when logging in rider api #132
This commit is contained in:
parent
3d186481ca
commit
a6b56e2fca
1 changed files with 23 additions and 0 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue