diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php index bbf2f399a..dc666400f 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php @@ -42,11 +42,10 @@ class AccompanyingCourseApiController extends ApiController switch ($request->getMethod()) { case Request::METHOD_POST: - $participation = $accompanyingPeriod->addPerson($person); + $participation = $accompanyingPeriod->createParticipationFor($person); break; case Request::METHOD_DELETE: - $participation = $accompanyingPeriod->removePerson($person); - $participation->setEndDate(new \DateTimeImmutable('now')); + $participation = $accompanyingPeriod->closeParticipationFor($person); break; default: throw new BadRequestException("This method is not supported");