mirror of
https://github.com/Karaka-Management/oms-Kanban.git
synced 2026-02-18 05:08:41 +00:00
impl. tests and fix validation status code
This commit is contained in:
parent
88fa7d67d1
commit
a8f4dbb7f5
|
|
@ -28,6 +28,7 @@ use phpOMS\Message\NotificationLevel;
|
||||||
use phpOMS\Message\RequestAbstract;
|
use phpOMS\Message\RequestAbstract;
|
||||||
use phpOMS\Message\ResponseAbstract;
|
use phpOMS\Message\ResponseAbstract;
|
||||||
use phpOMS\Model\Message\FormValidation;
|
use phpOMS\Model\Message\FormValidation;
|
||||||
|
use phpOMS\Message\Http\RequestStatusCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Kanban controller class.
|
* Kanban controller class.
|
||||||
|
|
@ -60,6 +61,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateKanbanCardCreate($request))) {
|
if (!empty($val = $this->validateKanbanCardCreate($request))) {
|
||||||
$response->set('kanban_card_create', new FormValidation($val));
|
$response->set('kanban_card_create', new FormValidation($val));
|
||||||
|
$response->getHeader()->setStatusCode(RequestStatusCode::R_400);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -139,6 +141,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateKanbanBoardCreate($request))) {
|
if (!empty($val = $this->validateKanbanBoardCreate($request))) {
|
||||||
$response->set('kanban_board_create', new FormValidation($val));
|
$response->set('kanban_board_create', new FormValidation($val));
|
||||||
|
$response->getHeader()->setStatusCode(RequestStatusCode::R_400);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -210,6 +213,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateKanbanColumnCreate($request))) {
|
if (!empty($val = $this->validateKanbanColumnCreate($request))) {
|
||||||
$response->set('kanban_column_create', new FormValidation($val));
|
$response->set('kanban_column_create', new FormValidation($val));
|
||||||
|
$response->getHeader()->setStatusCode(RequestStatusCode::R_400);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user