Fix constant name.

This commit is contained in:
Pol Dellaiera 2021-11-30 10:09:17 +01:00
parent 6e9827806f
commit e11c249131
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA

View File

@ -256,7 +256,7 @@ final class AccompanyingCourseApiController extends ApiController
public function toggleConfidentialApi(AccompanyingPeriod $accompanyingCourse, Request $request)
{
if ($request->getMethod() === 'POST') {
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::CONFIDENTIAL, $accompanyingCourse);
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::TOGGLE_CONFIDENTIAL, $accompanyingCourse);
$accompanyingCourse->setConfidential(!$accompanyingCourse->isConfidential());
$this->getDoctrine()->getManager()->flush();