소스 검색

fix: category delete now working (now accept symbols)

EduLascala 4 달 전
부모
커밋
94b361dc69
3개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      controllers/CategoryDeleteController.php
  2. 1 1
      controllers/CategoryUpdateFlagController.php
  3. 1 1
      controllers/ProductDeleteController.php

+ 1 - 1
controllers/CategoryDeleteController.php

@@ -23,7 +23,7 @@ class CategoryDeleteController
 
         try {
             v::key('company_id', v::intType()->positive())
-             ->key('category_name', v::stringType()->notEmpty()->alnum(' '))
+             ->key('category_name', v::stringType()->notEmpty()->regex('/^[\p{L}\p{N}\s\-\'\"]+$/u'))
              ->assert($body);
         } catch (ValidationException $e) {
             return ResponseLib::sendFail("Validation failed: " . $e->getFullMessage(), [], "E_VALIDATE")->withStatus(401);

+ 1 - 1
controllers/CategoryUpdateFlagController.php

@@ -23,7 +23,7 @@ class CategoryUpdateFlagController
 
         try {
             v::key('company_id', v::intType()->positive())
-             ->key('category_name', v::stringType()->notEmpty()->alnum(' '))
+             ->key('category_name', v::stringType()->notEmpty()->regex('/^[\p{L}\p{N}\s\-\'\"]+$/u'))
              ->key('category_flag', v::stringType()->notEmpty())
              ->assert($body);
         } catch (ValidationException $e) {

+ 1 - 1
controllers/ProductDeleteController.php

@@ -23,7 +23,7 @@ class ProductDeleteController
 
         try {
             v::key('company_id', v::intType()->positive())
-             ->key('product_name', v::stringType()->notEmpty()->alnum(' '))
+             ->key('product_name', v::stringType()->notEmpty()->regex('/^[\p{L}\p{N}\s\-\'\"]+$/u'))
              ->assert($body);
         } catch (ValidationException $e) {
             return ResponseLib::sendFail("Validation failed: " . $e->getFullMessage(), [], "E_VALIDATE")->withStatus(401);