Merge branch '147-location-support-dummy-api' into 'master'
Resolve "Location support dummy API" Closes #147 See merge request jankstudio/resq!142
This commit is contained in:
commit
68c3b8d4cc
2 changed files with 27 additions and 0 deletions
|
|
@ -114,3 +114,8 @@ api_resend_code:
|
|||
path: /api/resend_code
|
||||
controller: App\Controller\APIController:resendCode
|
||||
methods: [POST]
|
||||
|
||||
api_location_support:
|
||||
path: /api/location_support
|
||||
controller: App\Controller\APIController:locationSupport
|
||||
methods: [GET]
|
||||
|
|
|
|||
|
|
@ -1477,4 +1477,26 @@ class APIController extends Controller
|
|||
|
||||
return $res->getReturnResponse();
|
||||
}
|
||||
|
||||
public function locationSupport(Request $req)
|
||||
{
|
||||
$required_params = [
|
||||
'longitude',
|
||||
'latitude',
|
||||
];
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$res = $this->checkParamsAndKey($req, $em, $required_params);
|
||||
if ($res->isError())
|
||||
return $res->getReturnResponse();
|
||||
|
||||
|
||||
$data = [
|
||||
'longitude' => $req->query->get('longitude'),
|
||||
'latitude' => $req->query->get('latitude'),
|
||||
'supported' => true,
|
||||
];
|
||||
$res->setData($data);
|
||||
|
||||
return $res->getReturnResponse();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue