mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge origin/ci into ci
Conflicts: application/core/FHC_Model.php application/models/Nation_model.php application/models/lehre/Studiengang_model.php application/models/lehre/Studienplan_model.php
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
if(!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class File extends APIv1_Controller
|
||||
{
|
||||
/**
|
||||
* Person API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// Load model FileModel
|
||||
$this->load->model('file_model', 'FileModel');
|
||||
// Load set the uid of the model to let to check the permissions
|
||||
$this->FileModel->setUID($this->_getUID());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function postFile()
|
||||
{
|
||||
$result = $this->FileModel->saveFile($this->post());
|
||||
|
||||
if($result === TRUE)
|
||||
{
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
$payload = [
|
||||
'success' => true,
|
||||
'message' => 'File saved.'
|
||||
];
|
||||
$payload['data'] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$payload = [
|
||||
'success' => false,
|
||||
'message' => 'Could not save file.'
|
||||
];
|
||||
$httpstatus = REST_Controller::HTTP_OK;
|
||||
}
|
||||
$this->response($payload, $httpstatus);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user