adds a select to the profilUpdateRequests to change display between only pending and all requests

This commit is contained in:
SimonGschnell
2024-02-01 15:27:24 +01:00
parent d813f55a9b
commit e5182a20ac
2 changed files with 57 additions and 6 deletions
@@ -16,6 +16,7 @@ class ProfilUpdate extends Auth_Controller
'acceptProfilRequest'=>['user:r'],
'denyProfilRequest'=>['user:r'],
'show'=>['user:r'],
'getPendingRequests'=>['user:r'],
]);
@@ -49,6 +50,15 @@ class ProfilUpdate extends Auth_Controller
echo json_encode($res);
}
public function getPendingRequests(){
$res = $this->ProfilChangeModel->loadWhere(["status"=>"pending"]);
$res = hasData($res)? getData($res) : [];
echo json_encode($res);
}
public function acceptProfilRequest(){
$_POST = json_decode($this->input->raw_input_stream,true);