mirror of
https://gitlab.aliens-lyon.fr/encartes/backend.git
synced 2026-03-17 14:41:03 +01:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
62ad25b179
6
API.md
6
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,
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user