rewrite method add participation for new period's methods

This commit is contained in:
Julien Fastré 2021-05-10 13:24:57 +02:00
parent f3a8552829
commit 52637c2919

View File

@ -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");