mirror of
https://github.com/Karaka-Management/oms-Comments.git
synced 2026-02-18 02:08:41 +00:00
impl. tests and fix validation status code
This commit is contained in:
parent
fe4f7a60e9
commit
02d41f3140
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Orange Management
|
* Orange Management
|
||||||
*
|
*
|
||||||
|
|
@ -10,6 +11,7 @@
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @link https://orange-management.org
|
* @link https://orange-management.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\Comments\Controller;
|
namespace Modules\Comments\Controller;
|
||||||
|
|
@ -86,6 +88,7 @@ final class ApiController extends Controller
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateCommentCreate($request))) {
|
if (!empty($val = $this->validateCommentCreate($request))) {
|
||||||
$response->set('news_create', new FormValidation($val));
|
$response->set('news_create', new FormValidation($val));
|
||||||
|
$response->getHeader()->setStatusCode(RequestStatusCode::R_400);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Orange Management
|
* Orange Management
|
||||||
*
|
*
|
||||||
|
|
@ -10,6 +11,7 @@
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
* @link https://orange-management.org
|
* @link https://orange-management.org
|
||||||
*/
|
*/
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Modules\Comments\Controller;
|
namespace Modules\Comments\Controller;
|
||||||
|
|
@ -131,6 +133,7 @@ final class BackendController extends Controller
|
||||||
{
|
{
|
||||||
if (!empty($val = $this->validateCommentCreate($request))) {
|
if (!empty($val = $this->validateCommentCreate($request))) {
|
||||||
$response->set('comment_create', new FormValidation($val));
|
$response->set('comment_create', new FormValidation($val));
|
||||||
|
$response->getHeader()->setStatusCode(RequestStatusCode::R_400);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user