mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
add a discrimnator type on onbjects
This commit is contained in:
@@ -58,12 +58,12 @@ class AccompanyingCourseApiController extends ApiController
|
||||
|
||||
if ($errors->count() > 0) {
|
||||
// only format accepted
|
||||
return $this->json($errors);
|
||||
return $this->json($errors, 422);
|
||||
}
|
||||
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->json($participation);
|
||||
return $this->json($participation, 200, [], ['groups' => [ 'read' ]]);
|
||||
}
|
||||
|
||||
public function requestorApi($id, Request $request, string $_format): Response
|
||||
@@ -102,12 +102,12 @@ class AccompanyingCourseApiController extends ApiController
|
||||
|
||||
if ($errors->count() > 0) {
|
||||
// only format accepted
|
||||
return $this->json($errors);
|
||||
return $this->json($errors, 422);
|
||||
}
|
||||
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->json($accompanyingPeriod->getRequestor());
|
||||
return $this->json($accompanyingPeriod->getRequestor(), 200, [], ['groups' => [ 'read']]);
|
||||
}
|
||||
|
||||
protected function onPostCheckACL(string $action, Request $request, string $_format, $entity): ?Response
|
||||
|
Reference in New Issue
Block a user