mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
Adding an unrelated to issue to an accompanyingCourseWork
This commit is contained in:
@@ -34,6 +34,8 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Serializer\Exception\RuntimeException;
|
||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
use Symfony\Component\Validator\ConstraintViolationList;
|
||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Component\Workflow\Registry;
|
||||
use function array_values;
|
||||
@@ -294,4 +296,17 @@ final class AccompanyingCourseApiController extends ApiController
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function validate(string $action, Request $request, string $_format, $entity, array $more = []): ConstraintViolationListInterface
|
||||
{
|
||||
if ('work' !== $action) {
|
||||
return parent::validate($action, $request, $_format, $entity, $more);
|
||||
}
|
||||
|
||||
if (Request::METHOD_POST === $request->getMethod()) {
|
||||
return $this->getValidator()->validate($more[0], null);
|
||||
}
|
||||
|
||||
return new ConstraintViolationList([]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user