[DEV-161] Add apikey to ticket comment path (#1173)

* update ticket comment path

* update validations

* remove useless line
This commit is contained in:
Guillermo Giuliana 2022-03-29 13:48:46 -03:00 committed by GitHub
parent c64eb9930b
commit f890fdc2d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,8 +42,7 @@ class CommentController extends Controller {
private $imagePaths;
public function validations() {
$this->session = Session::getInstance();
return [
$validations = [
'permission' => 'user',
'requestData' => [
'content' => [
@ -56,6 +55,15 @@ class CommentController extends Controller {
]
]
];
if(Controller::request('captcha')){
$validations['permission'] = 'any';
$validations['requestData']['captcha'] = [
'validation' => DataValidator::captcha(APIKey::TICKET_CREATE_PERMISSION),
'error' => ERRORS::INVALID_CAPTCHA
];
}
return $validations;
}
public function handler() {