File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
routes/chat/[agentId]/[conversationId] Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ export const endpoints = {
4242 conversationDeletionUrl : `${ host } /conversation/{conversationId}` ,
4343 conversationDetailUrl : `${ host } /conversation/{conversationId}` ,
4444 conversationAttachmentUrl : `${ host } /conversation/{conversationId}/files/{messageId}` ,
45+ conversationUserUrl : `${ host } /conversation/{conversationId}/user` ,
4546 dialogsUrl : `${ host } /conversation/{conversationId}/dialogs` ,
4647 conversationMessageDeletionUrl : `${ host } /conversation/{conversationId}/message/{messageId}` ,
4748
Original file line number Diff line number Diff line change @@ -26,6 +26,17 @@ export async function getConversation(id) {
2626 return response . data ;
2727}
2828
29+ /**
30+ * Get conversation user
31+ * @param {string } id
32+ * @returns {Promise<import('$types').UserModel> }
33+ */
34+ export async function getConversationUser ( id ) {
35+ let url = replaceUrl ( endpoints . conversationUserUrl , { conversationId : id } ) ;
36+ const response = await axios . get ( url ) ;
37+ return response . data ;
38+ }
39+
2940/**
3041 * Get conversation list
3142 * @param {import('$types').ConversationFilter } filter
Original file line number Diff line number Diff line change 1515 sendMessageToHub ,
1616 GetDialogs ,
1717 deleteConversationMessage ,
18- getConversationFiles
18+ getConversationFiles ,
19+ getConversationUser
1920 } from ' $lib/services/conversation-service.js' ;
2021 import ' overlayscrollbars/overlayscrollbars.css' ;
2122 import { OverlayScrollbars } from ' overlayscrollbars' ;
107108 /** @type {import('$types').UserStateDetailModel[]} */
108109 let userAddStates = [];
109110
111+ /** @type {import('$types').UserModel} */
112+ let conversationUser;
113+
110114 /** @type {boolean} */
111115 let isLoadContentLog = false ;
112116 let isLoadStateLog = false ;
137141 onMount (async () => {
138142 autoScrollLog = true ;
139143 dialogs = await GetDialogs (params .conversationId );
144+ conversationUser = await getConversationUser (params .conversationId );
140145 initUserSentMessages (dialogs);
141146 initChatView ();
142147
875880 < div class = " col-md-4 col-7 head-left" >
876881 < div class = " m-1" > {agent? .name }< / div>
877882 < div class = " text-muted mb-0" >
878- < i class = " mdi mdi-circle text-success align-middle me-1" / > {currentUser ? .full_name || ' ' }
883+ < i class = " mdi mdi-circle text-success align-middle me-1" / > {conversationUser ? .full_name || ' ' }
879884 < / div>
880885 < / div>
881886
You can’t perform that action at this time.
0 commit comments