Remove related feedback and update stats when clearing chat in view messages
This commit is contained in:
parent
02b72f917a
commit
68d56be7c0
|
|
@ -604,6 +604,10 @@ export class App {
|
|||
if (sessionId) deleteOptions.sessionId = sessionId
|
||||
if (chatType) deleteOptions.chatType = chatType
|
||||
|
||||
// remove all related feedback records
|
||||
const feedbackDeleteOptions: FindOptionsWhere<ChatMessageFeedback> = { chatId }
|
||||
await this.AppDataSource.getRepository(ChatMessageFeedback).delete(feedbackDeleteOptions)
|
||||
|
||||
const results = await this.AppDataSource.getRepository(ChatMessage).delete(deleteOptions)
|
||||
return res.json(results)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -214,6 +214,7 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
|
|||
}
|
||||
})
|
||||
getChatmessageApi.request(chatflowid)
|
||||
getStatsApi.request(chatflowid) // update stats
|
||||
} catch (error) {
|
||||
const errorData = error.response.data || `${error.response.status}: ${error.response.statusText}`
|
||||
enqueueSnackbar({
|
||||
|
|
|
|||
Loading…
Reference in New Issue