This commit is contained in:
Paula Quispe
2019-09-11 10:28:28 -04:00
parent 235068ff46
commit a60b9b304a
3 changed files with 212 additions and 1 deletions

View File

@@ -39,6 +39,36 @@ class FilesManager extends Api
return $response;
}
/**
* Upload a file to templates or public files
*
* @url POST /:prj_uid/process-files-manager
* @url POST /:prj_uid/process-files-manager/:main_path
*
* @param string $prj_uid
* @param string $main_path
*
* @return array
* @throws RestException
*
* @access protected
* @class AccessControl {@permission PM_FACTORY}
*/
public function uploadDocumentToProject($prj_uid, $main_path = 'templates')
{
try {
$userUid = $this->getUserId();
$filesManager = new FilesManagerBusinessModel();
$response = $filesManager->uploadFilesManager($userUid, $prj_uid, $main_path);
} catch (ExceptionRestApi $e) {
throw new RestException($e->getCode(), $e->getMessage());
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
return $response;
}
/**
* Creates a file in the File Manager.
*