2024-09-17 16:44:02 +02:00
|
|
|
<template>
|
2024-09-18 09:28:59 +02:00
|
|
|
<div class="flex flex-col gap-2 h-full w-full overflow-y-auto">
|
|
|
|
<div v-if="communications != null" class="flex flex-col gap-2 w-full">
|
|
|
|
<MemberCommunicationListItem
|
|
|
|
v-for="communication in communications"
|
|
|
|
:key="communication.id"
|
|
|
|
:communication="communication"
|
|
|
|
/>
|
|
|
|
</div>
|
2024-09-17 16:44:02 +02:00
|
|
|
<Spinner v-if="loading == 'loading'" class="mx-auto" />
|
|
|
|
<p v-else-if="loading == 'failed'">laden fehlgeschlagen</p>
|
|
|
|
</div>
|
2024-09-26 13:16:31 +02:00
|
|
|
<div class="flex flex-row gap-4">
|
|
|
|
<button primary class="!w-fit" @click="">Kommunikation hinzufügen</button>
|
|
|
|
</div>
|
2024-09-17 16:44:02 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { defineComponent } from "vue";
|
|
|
|
import { mapActions, mapState } from "pinia";
|
|
|
|
import { useMemberStore } from "@/stores/admin/member";
|
|
|
|
import type { MemberViewModel, UpdateMemberViewModel } from "@/viewmodels/admin/member.models";
|
|
|
|
import Spinner from "@/components/Spinner.vue";
|
|
|
|
import type { CommunicationViewModel } from "@/viewmodels/admin/communication.models";
|
|
|
|
import { useCommunicationStore } from "@/stores/admin/communication";
|
2024-09-18 09:28:59 +02:00
|
|
|
import MemberCommunicationListItem from "@/components/admin/club/member/MemberCommunicationListItem.vue";
|
2024-09-17 16:44:02 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
export default defineComponent({
|
|
|
|
computed: {
|
|
|
|
...mapState(useCommunicationStore, ["communications", "loading"]),
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.fetchItem();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions(useCommunicationStore, ["fetchCommunicationsForMember"]),
|
|
|
|
fetchItem() {
|
|
|
|
this.fetchCommunicationsForMember();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|