mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +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()) {
|
switch ($request->getMethod()) {
|
||||||
case Request::METHOD_POST:
|
case Request::METHOD_POST:
|
||||||
$participation = $accompanyingPeriod->addPerson($person);
|
$participation = $accompanyingPeriod->createParticipationFor($person);
|
||||||
break;
|
break;
|
||||||
case Request::METHOD_DELETE:
|
case Request::METHOD_DELETE:
|
||||||
$participation = $accompanyingPeriod->removePerson($person);
|
$participation = $accompanyingPeriod->closeParticipationFor($person);
|
||||||
$participation->setEndDate(new \DateTimeImmutable('now'));
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new BadRequestException("This method is not supported");
|
throw new BadRequestException("This method is not supported");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user