opensupports/server/controllers/staff/get-tickets.php

36 lines
837 B
PHP
Raw Normal View History

<?php
use Respect\Validation\Validator as DataValidator;
2017-04-18 06:39:55 +02:00
/**
2017-04-21 08:09:24 +02:00
* @api {post} /staff/get-tickets Retrieve own tickets.
2017-04-18 06:39:55 +02:00
*
* @apiName Get tickets
*
* @apiGroup staff
*
2017-04-21 08:09:24 +02:00
* @apiDescription This path retrieves the tickets of current staff member.
2017-04-18 06:39:55 +02:00
*
* @apiPermission Staff level 1
*
2017-04-21 08:09:24 +02:00
* @apiUse NO_PERMISSION
*
2017-04-22 03:33:17 +02:00
* @apiSuccess {[Ticket](#api-Data_Structures-ObjectTicket)[]} data Array of tickets assigned to the staff
2017-04-18 06:39:55 +02:00
*
*/
class GetTicketStaffController extends Controller {
const PATH = '/get-tickets';
const METHOD = 'POST';
public function validations() {
return [
'permission' => 'staff_1',
'requestData' => []
];
}
public function handler() {
$user = Controller::getLoggedUser();
Response::respondSuccess($user->sharedTicketList->toArray());
}
}