diff --git a/client/src/components/DeletePartyLines.vue b/client/src/components/DeletePartyLines.vue index bea87d8..2fcb90a 100644 --- a/client/src/components/DeletePartyLines.vue +++ b/client/src/components/DeletePartyLines.vue @@ -1,44 +1,41 @@ diff --git a/client/src/stores/partyLine.ts b/client/src/stores/partyLine.ts index d477afd..2796ffb 100644 --- a/client/src/stores/partyLine.ts +++ b/client/src/stores/partyLine.ts @@ -2,13 +2,15 @@ import { defineStore } from 'pinia'; import { ref } from 'vue'; import { useGetServer } from "@/composables/useGetServer.ts"; import { useSound } from '@vueuse/sound'; -import notification from '../../public/notification.mp3'; +import notification from '/notification.mp3'; +import type { PartyLine } from "@/types/partyLine.ts"; export const usePartyLineStore = defineStore('partyLine', () => { + + const partyLines = ref([]); const partyLine = ref(''); const rumor = ref(''); const eventSource = ref(null); - const partyLines = ref([]); const partyLineDeletedFlag = ref(false); const { play } = useSound(notification); @@ -62,8 +64,7 @@ export const usePartyLineStore = defineStore('partyLine', () => { const fetchPartyLines = async () => { try { const response = await fetch(useGetServer() + '/partyLines'); - const data = await response.json(); - partyLines.value = data.allPartyLines; + partyLines.value = await response.json(); } catch (error: any) { console.error('Error fetching party lines:', error); } diff --git a/client/src/types/partyLine.ts b/client/src/types/partyLine.ts new file mode 100644 index 0000000..bf4b6b5 --- /dev/null +++ b/client/src/types/partyLine.ts @@ -0,0 +1,11 @@ +export type PartyLine = { + name: string; + clients: Client[]; + lastActivity: number; + lastEvent: string; +} + +export type Client = { + clientId: string; + ipAddress: string; +} diff --git a/client/src/views/AdminView.vue b/client/src/views/AdminView.vue index cb7c1a1..5cf42ed 100644 --- a/client/src/views/AdminView.vue +++ b/client/src/views/AdminView.vue @@ -7,7 +7,7 @@ import CreatePartyLine from "@/components/CreatePartyLine.vue"; \ No newline at end of file