mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-09 23:09:43 +00:00
Merge branch 'master' into upgrade-sf5
This commit is contained in:
@@ -137,7 +137,7 @@ class ApiController extends AbstractCRUDController
|
||||
try {
|
||||
$entity = $this->deserialize($action, $request, $_format, $entity);
|
||||
} catch (NotEncodableValueException $e) {
|
||||
throw new BadRequestHttpException('invalid json', 400, $e);
|
||||
throw new BadRequestHttpException('invalid json', $e, 400);
|
||||
}
|
||||
|
||||
$errors = $this->validate($action, $request, $_format, $entity);
|
||||
@@ -155,7 +155,7 @@ class ApiController extends AbstractCRUDController
|
||||
return $response;
|
||||
}
|
||||
|
||||
$this->managerRegistry->getManager()->flush();
|
||||
$this->managerRegistry->getManagerForClass($this->getEntityClass())->flush();
|
||||
|
||||
$response = $this->onAfterFlush($action, $request, $_format, $entity, $errors);
|
||||
|
||||
@@ -177,7 +177,7 @@ class ApiController extends AbstractCRUDController
|
||||
public function indexApi(Request $request, string $_format)
|
||||
{
|
||||
return match ($request->getMethod()) {
|
||||
Request::METHOD_GET, REQUEST::METHOD_HEAD => $this->indexApiAction('_index', $request, $_format),
|
||||
Request::METHOD_GET, Request::METHOD_HEAD => $this->indexApiAction('_index', $request, $_format),
|
||||
default => throw $this->createNotFoundException('This method is not supported'),
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user