From 366cef7a0a1d2e4368c312296c9df2ac25bc0a0c Mon Sep 17 00:00:00 2001 From: Kouril42 Date: Tue, 21 Feb 2023 16:23:11 +0100 Subject: [PATCH 1/3] Change Eleveator to Lift --- src/Entity/Place.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/Place.php b/src/Entity/Place.php index ec2ff5a..bf5cdf7 100644 --- a/src/Entity/Place.php +++ b/src/Entity/Place.php @@ -71,7 +71,7 @@ class Place } public function setType(string $type): bool { - if ($type == 'C' or $type == 'S' or $type == 'E' or $type == 'R') { + if ($type == 'C' or $type == 'S' or $type == 'L' or $type == 'R') { $this->type = $type; return true; } From ce3563f6278f545bfcc51f2f63dffab1d26bd1fa Mon Sep 17 00:00:00 2001 From: Kouril42 Date: Tue, 21 Feb 2023 16:25:43 +0100 Subject: [PATCH 2/3] get_all_floors was returning lists of lists, which was stupid, it now returns lists --- src/Controller/MapApiController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Controller/MapApiController.php b/src/Controller/MapApiController.php index e994549..0d7e45e 100644 --- a/src/Controller/MapApiController.php +++ b/src/Controller/MapApiController.php @@ -122,11 +122,11 @@ class MapApiController extends AbstractController foreach ($s->getBuildings() as $b) { $buildJSON = array(); foreach ($b->getFloors() as $f){ - $buildJSON[] = array(['name' => $f->getName(), 'id' => $f->getId()]); + $buildJSON[] = array('name' => $f->getName(), 'id' => $f->getId()); } - $siteJSON[] = array(['name' => $b->getName(), 'id' => $b->getId(), 'floors' => $buildJSON]); + $siteJSON[] = array('name' => $b->getName(), 'id' => $b->getId(), 'floors' => $buildJSON); } - $response[] = array(['name' => $s->getName(), 'id' => $s->getId(), 'buildings' => $siteJSON]); + $response[] = array('name' => $s->getName(), 'id' => $s->getId(), 'buildings' => $siteJSON); } return $this->json($response); } From a84bf895f31deea5b77603d3f762ac0940b28947 Mon Sep 17 00:00:00 2001 From: Kouril42 Date: Tue, 21 Feb 2023 16:26:10 +0100 Subject: [PATCH 3/3] Precise API which was unclear --- API.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/API.md b/API.md index 92480fb..27c1d6b 100644 --- a/API.md +++ b/API.md @@ -37,7 +37,7 @@ __Errors :__ --------------------- -### /api/map/ +### /api/map/get_all_floors/ > Return every sites, buildings and floors of the DB. __The json will look like :__ @@ -151,9 +151,9 @@ __Errors :__ --------------------- ### /api/map/get_all_editions - > Return a list of all editions currently pending. + > Return a list of all editions currently pending. ie returns a table of dict, each representing en edition. -__Each place is a dict :__ +__Each edition is a dict :__ ```json { 'id': int // id of the edition,