currentEventCalculation

This commit is contained in:
2024-11-30 13:11:55 +01:00
parent 5de13e8a2b
commit 620e615e72
8 changed files with 89 additions and 7 deletions
@@ -10,6 +10,7 @@ import type { IRegistration } from '@/shared/model/registration.model';
import RegistrationService from '@/entities/registration/registration.service';
import UserService from '@/entities/user/user.service';
import type AccountService from '@/account/account.service';
import { useStore } from '@/store';
// import type EventService from '@/account/account.service';
export default defineComponent({
@@ -33,10 +34,18 @@ export default defineComponent({
const event: Ref<IEvent> = ref({});
const sortedAndIndexedRegistrations: Ref<IRegistration[]> = ref([]);
let store = useStore();
const retrieveEvent = async (eventId: string) => {
try {
console.log('event' + eventId);
let currentEventId = '' + store.currentEventId;
if (eventId == 'useCurrentEventId') {
eventId = currentEventId;
console.log('event2' + eventId);
}
const res = await eventService().find(eventId);
isCurrentEvent.value = eventId == '2601';
isCurrentEvent.value = eventId == currentEventId;
event.value = res;
// sortedAndIndexedRegistrations.value = res.registrations;
sortedAndIndexedRegistrations.value = res.registrations.sort(