mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
throw 403 error instead of 422 and display toast message
This commit is contained in:
@@ -332,11 +332,6 @@ final class AccompanyingCourseApiController extends ApiController
|
||||
|
||||
$accompanyingCourse->setConfidential(!$accompanyingCourse->isConfidential());
|
||||
|
||||
$errors = $this->validator->validate($accompanyingCourse);
|
||||
|
||||
if ($errors->count() > 0) {
|
||||
return $this->json($errors, 422);
|
||||
}
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
}
|
||||
|
||||
@@ -349,6 +344,7 @@ final class AccompanyingCourseApiController extends ApiController
|
||||
*/
|
||||
public function toggleIntensityApi(AccompanyingPeriod $accompanyingCourse, Request $request)
|
||||
{
|
||||
|
||||
if ($request->getMethod() === 'POST') {
|
||||
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::TOGGLE_INTENSITY, $accompanyingCourse);
|
||||
|
||||
|
Reference in New Issue
Block a user