mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 01:12:17 +00:00
getNations
This commit is contained in:
@@ -8,7 +8,6 @@ class Kontakt extends FHC_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(chris): access!
|
||||
parent::__construct();
|
||||
|
||||
// Load Libraries
|
||||
@@ -217,6 +216,21 @@ class Kontakt extends FHC_Controller
|
||||
return $this->outputJsonSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
public function getNations()
|
||||
{
|
||||
$this->load->model('codex/Nation_model', 'NationModel');
|
||||
|
||||
$this->NationModel->addOrder('kurztext');
|
||||
|
||||
$result = $this->NationModel->load();
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
} else {
|
||||
$this->outputJson(getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
|
||||
public function getAdressentypen()
|
||||
{
|
||||
$this->load->model('person/Adressentyp_model', 'AdressentypModel');
|
||||
|
||||
@@ -275,7 +275,7 @@ export default{
|
||||
},
|
||||
created(){
|
||||
CoreRESTClient
|
||||
.get('components/stv/Student/getNations')
|
||||
.get('components/stv/Kontakt/getNations')
|
||||
.then(result => {
|
||||
this.nations = result.data;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user