From 7d2e919c7f502a3fbac1348e600dd41d53ded86f Mon Sep 17 00:00:00 2001 From: Iris Olfermann Date: Mon, 2 Oct 2023 14:09:21 +0200 Subject: [PATCH] Optimized list display and refactored --- .../src/api/getParticipationsByDate.ts | 7 +++-- .../dashboard/ParticipantsListModal.vue | 5 +--- .../src/views/ParticipantsListByDay.vue | 28 ++++++++----------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/Resources/src/api/getParticipationsByDate.ts b/src/Resources/src/api/getParticipationsByDate.ts index e2d2dcf28..6a2256a0e 100644 --- a/src/Resources/src/api/getParticipationsByDate.ts +++ b/src/Resources/src/api/getParticipationsByDate.ts @@ -1,6 +1,6 @@ import useApi from '@/api/api'; import type { DateTime } from '@/api/getDashboardData'; -import { onMounted, reactive, readonly, ref } from 'vue'; +import { onMounted, onUnmounted, reactive, readonly, ref } from 'vue'; import type { Dictionary } from '../../types/types'; export type ListData = { @@ -19,13 +19,16 @@ const listDataState = reactive({ }); export function useParticipantsByDayData(date: string){ - console.log(date); const loaded = ref(false) onMounted(async () => { await getListData(); }); + onUnmounted(() => { + listDataState.data = {}; + }); + async function getListData() { const { response: listData, request, error } = useApi( diff --git a/src/Resources/src/components/dashboard/ParticipantsListModal.vue b/src/Resources/src/components/dashboard/ParticipantsListModal.vue index 0f4644e83..d94a1a3ad 100644 --- a/src/Resources/src/components/dashboard/ParticipantsListModal.vue +++ b/src/Resources/src/components/dashboard/ParticipantsListModal.vue @@ -1,4 +1,3 @@ -