add a discrimnator type on onbjects

This commit is contained in:
2021-05-12 17:51:37 +02:00
parent f7a807473d
commit 91e4d585ff
17 changed files with 236 additions and 109 deletions

View File

@@ -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