filter hidden from kontakttyp, show typ.beschreibung in dropdown

This commit is contained in:
ma0068
2025-03-12 08:06:23 +01:00
parent 1f5925e860
commit ea2be8026b
2 changed files with 9 additions and 8 deletions
@@ -439,6 +439,7 @@ class Kontakt extends FHCAPI_Controller
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
}
public function getKontakttypen()
@@ -446,13 +447,13 @@ class Kontakt extends FHCAPI_Controller
$this->load->model('person/Kontakttyp_model', 'KontakttypModel');
$result = $this->KontakttypModel->load();
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
else
{
$this->terminateWithSuccess(getData($result) ?: []);
}
$data = $this->getDataOrTerminateWithError($result);
$filteredData = array_filter($data, function ($item) {
return $item->kontakttyp !== "hidden";
});
$this->terminateWithSuccess($filteredData);
}
public function loadContact()