mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
rewrite method add participation for new period's methods
This commit is contained in:
parent
f3a8552829
commit
52637c2919
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user