diff --git a/src/stores/chat-store.ts b/src/stores/chat-store.ts index 6df4c80..4e8a60d 100644 --- a/src/stores/chat-store.ts +++ b/src/stores/chat-store.ts @@ -1,5 +1,5 @@ import { defineStore } from 'pinia'; -import {chat, responseModel} from 'src/models'; +import {chat, profilePicture, responseModel} from 'src/models'; import { api } from 'src/boot/axios'; import { useUserStore } from 'stores/user-store'; @@ -8,7 +8,7 @@ export const useChatStore = defineStore('chatStore',{ chats: [] as chat[], chatsLoaded: false, chatExistsReponse: false, - profilePictures : [] as string[], + profilePictures : [] as profilePicture[], profilePicturesLoaded: false }), actions: { @@ -24,7 +24,9 @@ export const useChatStore = defineStore('chatStore',{ return this.chats; }, async loadProfilePictures(){ - this.profilePictures = (await api.get("/users/profilePictures")).data; + (await api.get("/chats/profilePictures")).data.forEach((element: string) => { + this.profilePictures.push({shortName: element.split(" ")[0].replace(":", ""), url: element.split(" ")[1]}); + }); this.profilePicturesLoaded = true; }, async createChat(chatName: string, members: string[]){