prepare customer registration cancel
This commit is contained in:
@@ -10,6 +10,7 @@ namespace customerapi\controllers;
|
||||
|
||||
|
||||
use common\models\Event;
|
||||
use common\models\EventRegistration;
|
||||
use customerapi\models\available\EventInterval;
|
||||
use customerapi\models\available\EventAvailable;
|
||||
use customerapi\models\DayToDisplay;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user