mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
add Studiengang Endpoint getStudiengangByKz
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class StudiengangEP extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* StudiengangEP API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'getStudiengangByKz' => self::PERM_LOGGED
|
||||
)
|
||||
);
|
||||
// Load model StudiengangModel
|
||||
$this->load->model('organisation/studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function getStudiengangByKz()
|
||||
{
|
||||
$studiengang_kz = intval($this->input->get('studiengang_kz'));
|
||||
|
||||
$this->StudiengangModel->addSelect('studiengang_kz, kurzbz, kurzbzlang, '
|
||||
. 'typ, bezeichnung, english, aktiv, orgform_kurzbz, sprache, '
|
||||
. 'oe_kurzbz');
|
||||
$result = $this->StudiengangModel->load($studiengang_kz);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
}
|
||||
|
||||
$stg = null;
|
||||
if(hasData($result))
|
||||
{
|
||||
$stg = (getData($result))[0];
|
||||
}
|
||||
$this->terminateWithSuccess($stg);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,13 @@ export default {
|
||||
"/api/frontend/v1/Studgang/getStudiengangInfo",
|
||||
{}
|
||||
);
|
||||
},
|
||||
getStudiengangByKz: function (studiengang_kz) {
|
||||
return this.$fhcApi.get(
|
||||
"/api/frontend/v1/organisation/StudiengangEP/getStudiengangByKz",
|
||||
{
|
||||
"studiengang_kz": studiengang_kz
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user