diff --git a/build/api/module/departmentController.php b/build/api/module/departmentController.php index 513aa95..2c3035b 100644 --- a/build/api/module/departmentController.php +++ b/build/api/module/departmentController.php @@ -24,9 +24,9 @@ class departmentController /** @var professor $prof_repo */ $prof_repo = Repo::getRepo('professor'); - $deps = $prof_repo->getLinkedDepartment($_SESSION['CAS']['login']); + $deps = $prof_repo->getLinkedDepartments($_SESSION['CAS']['login']); - if(is_array($deps)){ + if( count($deps) > 0 ){ foreach ($deps as $dep){ if($dep["idDep"] == $department){ $_SESSION["AvailableDepartment"] = $deps;