prepare customer registration cancel

This commit is contained in:
2020-04-18 07:21:54 +02:00
committed by Roland Schneider
parent f175258bc9
commit e87adb36fd
7 changed files with 115 additions and 30 deletions

View File

@@ -45,12 +45,11 @@ class EventRegistrationController extends CustomerApiController
public function actionRegistration($id_registration)
{
$registrations = $this->prepareQueryFindRegistrationsForCustomer()
->andWhere(['id_event_registration' => $id_registration])
->andWhere(['event_registration.id' => $id_registration])
->one();
return $this->asJson(
$registrations
);
}
/**
@@ -92,4 +91,19 @@ class EventRegistrationController extends CustomerApiController
}
/**
* Cancel a registration by id
* @noinspection PhpUnused
* @param $idRegistraton
* @throws Throwable
* @return Response
*/
public function actionCancel($idRegistraton) {
$manager = new EventRegistrationManager();
$registration = $manager->loadRegistration($idRegistraton);
$manager->deleteRegistration($registration);
$registration = $manager->loadRegistration($idRegistraton);
return $this->asJson($registration);
}
}