opensupports/server/controllers/ticket/get-custom-responses.php

39 lines
939 B
PHP
Raw Normal View History

<?php
use Respect\Validation\Validator as DataValidator;
DataValidator::with('CustomValidations', true);
2017-04-17 04:59:11 +02:00
/**
* @api {post} /ticket/get-custom-responses Get custom responses
* @apiVersion 4.0.0
2017-04-17 04:59:11 +02:00
*
* @apiName Get custom responses
*
* @apiGroup Ticket
*
* @apiDescription This path returns all the custom responses.
2017-04-17 04:59:11 +02:00
*
* @apiPermission staff1
2017-04-17 04:59:11 +02:00
*
2017-04-21 08:09:24 +02:00
* @apiUse NO_PERMISSION
*
2017-04-21 05:34:20 +02:00
* @apiSuccess {[CustomResponse](#api-Data_Structures-ObjectCustomresponse)[]} data List of custom responses.
2017-04-17 04:59:11 +02:00
*
*/
class GetCustomResponsesController extends Controller {
const PATH = '/get-custom-responses';
const METHOD = 'POST';
public function validations() {
return [
'permission' => 'staff_1',
'requestData' => []
];
}
public function handler() {
$customResponsesList = CustomResponse::getAll();
Response::respondSuccess($customResponsesList->toArray());
}
}