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, 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); } 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; }