diff --git a/customer/app/src/app/pages/registration/registration.component.html b/customer/app/src/app/pages/registration/registration.component.html
index edba6ed..8f0a4fc 100644
--- a/customer/app/src/app/pages/registration/registration.component.html
+++ b/customer/app/src/app/pages/registration/registration.component.html
@@ -25,12 +25,21 @@
Terem
{{registration.event?.room?.name }}
+
+
Státusz
+
+ {{ "Lemondva" }}
+ {{ "Aktív" }}
+
+
diff --git a/customer/app/src/app/pages/registration/registration.component.ts b/customer/app/src/app/pages/registration/registration.component.ts
index 074c8a1..a8f386d 100644
--- a/customer/app/src/app/pages/registration/registration.component.ts
+++ b/customer/app/src/app/pages/registration/registration.component.ts
@@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core';
-import {Event, EventService, Registration} from "../../services/event.service";
-import {Observable} from "rxjs";
+import { EventService, Registration} from "../../services/event.service";
import {ActivatedRoute, Router} from "@angular/router";
import {tap} from "rxjs/operators";
import {NavigationService} from "../../services/navigation.service";
@@ -23,11 +22,6 @@ export class RegistrationComponent implements OnInit {
this.activeRoute.params.subscribe( value => {
console.info("map: ", this.activeRoute.snapshot.paramMap);
let registration = this.eventService.findRegistration(+this.activeRoute.snapshot.paramMap.get('idRegistration'));
- registration = registration.pipe(
- tap(x => {
- console.info("reg",x);
- })
- );
registration.subscribe(
value1 => {
@@ -50,10 +44,10 @@ export class RegistrationComponent implements OnInit {
}
mayCancel(registration: Registration) {
- return true;
+ return registration.deleted_at == null;
}
goBack() {
- this.navigationService.navigateToHome();
+ this.navigationService.navigateRegistrations();
}
}
diff --git a/customer/app/src/app/services/event.service.ts b/customer/app/src/app/services/event.service.ts
index d92fd22..cf5a1a2 100644
--- a/customer/app/src/app/services/event.service.ts
+++ b/customer/app/src/app/services/event.service.ts
@@ -104,6 +104,7 @@ export interface EventsAvailableResponse {
export interface Registration {
id: number;
created_at: number;
+ deleted_at: number;
event?: Event
}
diff --git a/customerapi/controllers/EventRegistrationController.php b/customerapi/controllers/EventRegistrationController.php
index 8c1455c..64134d1 100644
--- a/customerapi/controllers/EventRegistrationController.php
+++ b/customerapi/controllers/EventRegistrationController.php
@@ -74,11 +74,11 @@ class EventRegistrationController extends CustomerApiController
* @throws Throwable
* @return Response
*/
- public function actionCancel($idRegistraton) {
- $manager = new EventRegistrationManager();
- $registration = $manager->loadRegistration($idRegistraton);
+ public function actionCancel($idRegistration) {
+ $manager = new \common\manager\EventRegistrationManager();
+ $registration = $manager->loadRegistration($idRegistration);
$manager->deleteRegistration($registration);
- $registration = $manager->loadRegistration($idRegistraton);
+ $registration = $manager->loadRegistration($idRegistration);
return $this->asJson($registration);
}
diff --git a/customerapi/models/registrations/EventRegistrationAvailable.php b/customerapi/models/registrations/EventRegistrationAvailable.php
index 60dbff5..757d3f4 100644
--- a/customerapi/models/registrations/EventRegistrationAvailable.php
+++ b/customerapi/models/registrations/EventRegistrationAvailable.php
@@ -17,6 +17,7 @@ class EventRegistrationAvailable extends EventRegistration
"id" => "id",
"created_at" => "created_at",
"updated_at" => "updated_at",
+ "deleted_at" => "deleted_at",
];
$fields['event'] = 'event';
return $fields;