Ivan - Backend - Add validator to /ticket/get [skip ci]

This commit is contained in:
ivan 2016-09-09 00:41:59 -03:00
parent da7aad3576
commit 7b6f9e28c8
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ class TicketGetController extends Controller {
'permission' => 'user',
'requestData' => [
'ticketNumber' => [
'validation' => DataValidator::length(6),
'validation' => DataValidator::validTicketNumber(),
'error' => ERRORS::INVALID_TICKET
]
]
@ -22,7 +22,7 @@ class TicketGetController extends Controller {
$ticket = Ticket::getByTicketNumber($ticketNumber);
if ($ticket->isNull() || $ticket->author->id != Controller::getLoggedUser()->id) {
if ($ticket->author->id != Controller::getLoggedUser()->id) {
Response::respondError(ERRORS::INVALID_TICKET);
} else {
Response::respondSuccess($ticket->toArray());