updates editAdressen in the Profil

This commit is contained in:
SimonGschnell
2024-07-08 15:15:08 +02:00
parent 92afdf71cd
commit 84029fc729
9 changed files with 194 additions and 131 deletions
@@ -34,6 +34,8 @@ class Profil extends FHCAPI_Controller
parent::__construct([
'getView' => self::PERM_LOGGED,
'fotoSperre' => self::PERM_LOGGED,
'getGemeinden' => self::PERM_LOGGED,
]);
@@ -143,6 +145,31 @@ class Profil extends FHCAPI_Controller
$this->terminateWithSuccess(current($res));
}
public function getGemeinden($nation, $zip)
{
if(!isset($nation) || !isset($zip)){
echo json_encode(error("Missing parameters"));
return;
}
$this->load->model('codex/Gemeinde_model', "GemeindeModel");
$gemeinde_res = $this->GemeindeModel->getGemeindeByPlz($zip);
if (isError($gemeinde_res)) {
$this->terminateWithError(getError($gemeinde_res),self::ERROR_TYPE_GENERAL);
}
$gemeinde_res = $this->getDataOrTerminateWithError($gemeinde_res);
/* $gemeinde_res = array_map(function ($obj) {
return $obj->ortschaftsname;
}, $gemeinde_res); */
$this->terminateWithSuccess($gemeinde_res);
}
// -----------------------------------------------------------------------------------------------------------------
// Private methods