From 52637c2919182878e156d098650a2ce8b635464f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 10 May 2021 13:24:57 +0200 Subject: [PATCH] rewrite method add participation for new period's methods --- .../Controller/AccompanyingCourseApiController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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");