From fe68d468313f0562f04e58185c84865f5f6c7277 Mon Sep 17 00:00:00 2001 From: Ivymaster Date: Tue, 14 Apr 2026 16:17:38 +0200 Subject: [PATCH] add endpoint for fetching all study plans --- .../api/frontend/v1/organisation/Studienplan.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/controllers/api/frontend/v1/organisation/Studienplan.php b/application/controllers/api/frontend/v1/organisation/Studienplan.php index c5a69fdee..ab4fb0755 100644 --- a/application/controllers/api/frontend/v1/organisation/Studienplan.php +++ b/application/controllers/api/frontend/v1/organisation/Studienplan.php @@ -20,10 +20,19 @@ class Studienplan extends FHCAPI_Controller { // TODO(chris): access! parent::__construct([ + 'getAllStudyPlans' => self::PERM_LOGGED, 'getBySemester' => self::PERM_LOGGED ]); } + public function getAllStudyPlans() + { + $this->load->model('organisation/Studienplan_model', 'StudienplanModel'); + $result = $this->StudienplanModel->load(); + $studien_plan_result = $this->getDataOrTerminateWithError($result); + $this->terminateWithSuccess($studien_plan_result); + } + public function getBySemester() { $this->load->model('organisation/Studienplan_model', 'StudienplanModel');