adds selectProfilRequest to the new ProfilUpdate FhcAPIController

This commit is contained in:
SimonGschnell
2024-07-19 13:11:58 +02:00
parent be66150631
commit a06f9b581f
4 changed files with 36 additions and 22 deletions
@@ -43,6 +43,7 @@ class ProfilUpdate extends FHCAPI_Controller
'getProfilRequestFiles' => self::PERM_LOGGED,
'denyProfilRequest' => ['student/stammdaten:rw', 'mitarbeiter/stammdaten:rw'],
'acceptProfilRequest' => ['student/stammdaten:rw', 'mitarbeiter/stammdaten:rw'],
'selectProfilRequest' => self::PERM_LOGGED,
]);
@@ -115,6 +116,24 @@ class ProfilUpdate extends FHCAPI_Controller
$this->terminateWithSuccess(self::$TOPICS);
}
public function selectProfilRequest()
{
$uid = $this->input->get('uid',true);
$id = $this->input->get('id',true);
$whereClause = ['uid' => $this->uid];
if (isset($uid))
$whereClause['uid'] = $uid;
if (isset($id))
$whereClause['id'] = $id;
$res = $this->ProfilUpdateModel->getProfilUpdatesWhere($whereClause);
$res = $this->getDataOrTerminateWithError($res);
$this->terminateWithSuccess($res);
}
public function getProfilRequestFiles($id)
{
if(!$id){