From d12ca80375a3b30466f5d7ea4ca46de154e9a17b Mon Sep 17 00:00:00 2001 From: joschuatonn Date: Thu, 30 May 2024 09:15:51 +0200 Subject: [PATCH] Users can now be removed from chats --- src/components/ChatSettingsComponent.vue | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/ChatSettingsComponent.vue b/src/components/ChatSettingsComponent.vue index cfb48b6..6db68f9 100644 --- a/src/components/ChatSettingsComponent.vue +++ b/src/components/ChatSettingsComponent.vue @@ -16,7 +16,7 @@ - + @@ -67,8 +67,10 @@ import { computed, ref } from 'vue'; import ProfileCardComponent from './ProfileCardComponent.vue'; import { useUserStore } from 'src/stores/user-store'; -import { profilePicture } from 'src/models'; +import { profilePicture, responseModel } from 'src/models'; import { useChatStore } from 'src/stores/chat-store'; +import { useQuasar } from 'quasar'; +import { sendNotification } from 'src/utils'; const showDialog = ref(true); const userStore = useUserStore(); @@ -92,6 +94,19 @@ import { useChatStore } from 'src/stores/chat-store'; const selectProfilePicture = (image: profilePicture) => { props.chat!.profilepicture = image.url; } + + const $q = useQuasar(); + + const removeUser = (keycloakID : string) => { + chatStore.removeUserFromChat(keycloakID, props.chat!.id).then((response : responseModel) => { + reloadChats(); + sendNotification(response.message, response.success); + }); + } + + const reloadChats = async() => { + await chatStore.loadChatsByUser(); + };