/**
  * @EXT\Route(
  *     "/api/cursus/location/{location}/delete",
  *     name="api_delete_cursus_location",
  *     options = {"expose"=true}
  * )
  * @EXT\ParamConverter("user", converter="current_user")
  *
  * Deletes session event
  *
  * @return \Symfony\Component\HttpFoundation\JsonResponse
  */
 public function deleteLocationAction(Location $location)
 {
     if ($location->getType() !== Location::TYPE_TRAINING) {
         throw new AccessDeniedException();
     }
     $serializedLocation = $this->serializer->serialize($location, 'json', SerializationContext::create()->setGroups(['api_user_min']));
     $this->locationManager->delete($location);
     return new JsonResponse($serializedLocation, 200);
 }