get_all_floors was returning lists of lists, which was stupid, it now returns lists

This commit is contained in:
Kouril42 2023-02-21 16:25:43 +01:00
parent 366cef7a0a
commit ce3563f627

View File

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