diff --git a/Source/API/script/index.php b/Source/API/script/index.php index ec4e576..68cb3a3 100644 --- a/Source/API/script/index.php +++ b/Source/API/script/index.php @@ -43,9 +43,7 @@ $app->get('/', function (Request $request, Response $response) { try { if (method_exists($gateway, $method)) { $ok = true; - $rep = (new $gateway)->$method($parameters); - echo $rep[0]; - #$response->getBody()->write(json_encode("1")); + $response->getBody()->write(json_encode((new $gateway)->$method($parameters))); } }catch (PDOException $e){ throw new PDOError($request,$e->getMessage(),$e); @@ -54,16 +52,6 @@ $app->get('/', function (Request $request, Response $response) { if (!$ok){ throw new HttpNotFoundError($request); } - /* - $temp = array(0 => array("id" => "1", - "0" => "1", - "title" => "Votre avis nous intéresse !", - "1" => "Votre avis nous intéresse !", - "description" => "Ce formulaire vous permet de candidater à une potentielle interview si votre profil nous intéresse.", - "2" => "Ce formulaire vous permet de candidater à une potentielle interview si votre profil nous intéresse." - )); - $response->getBody()->write(json_encode($temp)); - */ return $response->withHeader('Content-type', 'application/json'); });