From 622e569aef6aefcdcec3bbb2efbc997d2a9386d9 Mon Sep 17 00:00:00 2001 From: rodude123 Date: Thu, 30 Dec 2021 20:34:38 +0000 Subject: [PATCH] added in contact links in the find me section of the contact section --- src/api/index.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/api/index.php b/src/api/index.php index 7a0b915..0476c1a 100644 --- a/src/api/index.php +++ b/src/api/index.php @@ -49,15 +49,14 @@ $app->get("/timelineData/{timeline}", function (Request $request, Response $resp $json = json_encode($result); $response->getBody()->write($json); - return $response; -// //if it is an error give a 403 code since it can't find the data -// if(array_key_exists("errorMessage", $result[-1])) -// { -// $response = $response->withStatus(403); -// } -// -// //use content type json to indicate json data on frontend. -// return $response->withHeader("Content-Type", "application/json"); + //if it is an error give a 403 code since it can't find the data + if(array_key_exists("errorMessage", $result[0])) + { + $response = $response->withStatus(403); + } + + //use content type json to indicate json data on frontend. + return $response->withHeader("Content-Type", "application/json"); }); $app->get('/projectData', function (Request $request, Response $response) @@ -70,7 +69,7 @@ $app->get('/projectData', function (Request $request, Response $response) $response->getBody()->write($json); - if(array_key_exists("errorMessage", $result[-1])) + if(array_key_exists("errorMessage", $result[0])) { $response = $response->withStatus(403); } -- 2.43.0