Commit 1acae3f2 authored by Quentin Ribac's avatar Quentin Ribac
Browse files

FEAT #17436 TIME 0:10 fixed validation

parent 22eef48f
......@@ -175,7 +175,7 @@ class GroupController
public function getGroupPrivilege(Request $request, Response $response, array $args)
{
if (!Validator::intType()->validate($args['id'])) {
if (!Validator::intVal()->notEmpty()->validate($args['id'])) {
return $response->withStatus(400)->withJson(['errors' => 'Route id in not an integer']);
}
if (!Validator::stringType()->notEmpty()->validate($args['privilegeId'])) {
......
......@@ -100,8 +100,7 @@ class GroupPrivilegeModel
{
ValidatorModel::notEmpty($args, ['groupId', 'privilegeId']);
ValidatorModel::intVal($args, ['groupId']);
ValidatorModel::stringType($args, ['privilegeId']);
ValidatorModel::arrayType($args, ['parameters']);
ValidatorModel::stringType($args, ['privilegeId', 'parameters']);
DatabaseModel::update([
'table' => 'groups_privileges',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment