mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 05:00:50 +03:00
Remove related feedback and update stats when clearing chat in view messages
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user