Fix route

parent 94aa404d
......@@ -106,7 +106,7 @@ class App
*/
public function validateAmka($req, $res, $args)
{
$detailed_info = isset($args['extended']);
$detailed_info = isset($args['extended']) && ($args['extended'] == 'extended');
$amka = $args['amka'];
$surname = $args['surname'];
$bdate = '';
......@@ -128,7 +128,7 @@ class App
if ($fields_requested) {
$field_names = explode(',', $fields_requested);
}
$detailed_info = $detailed_info || count($field_names) > 0;
$detailed_info = $detailed_info || (count($field_names) > 0);
$this->logger->info("validateAmka::{$amka}");
......
<?php
$app->get('/amka/{amka}/{surname}[/extended]', '\Gr\Gov\Minedu\Osteam\Slim\App:validateAmka');
$app->get('/amka/{amka}/{surname}[/{extended}]', '\Gr\Gov\Minedu\Osteam\Slim\App:validateAmka');
$app->any('/[{anythingelse}]', function ($request, $response, $args) {
$this->logger->info("Void response, no action route was enabled");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment