Bugfix/delete messages via sessionId (#3982)

delete messages via sessionId
This commit is contained in:
Henry Heng 2025-02-04 09:50:46 +00:00 committed by GitHub
parent a0b4abdd13
commit 01cb3ef20d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -180,6 +180,7 @@ const removeAllChatMessages = async (req: Request, res: Response, next: NextFunc
const messages = await utilGetChatMessage({
chatflowid,
chatTypes,
sessionId,
startDate,
endDate,
feedback: isFeedback,

View File

@ -247,7 +247,7 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
const obj = { chatflowid, isClearFromViewMessageDialog: true }
let _chatTypeFilter = chatTypeFilter
if (typeof chatTypeFilter === 'string') {
if (typeof chatTypeFilter === 'string' && chatTypeFilter.startsWith('[') && chatTypeFilter.endsWith(']')) {
_chatTypeFilter = JSON.parse(chatTypeFilter)
}
if (_chatTypeFilter.length === 1) {
@ -255,7 +255,7 @@ const ViewMessagesDialog = ({ show, dialogProps, onCancel }) => {
}
let _feedbackTypeFilter = feedbackTypeFilter
if (typeof feedbackTypeFilter === 'string') {
if (typeof feedbackTypeFilter === 'string' && feedbackTypeFilter.startsWith('[') && feedbackTypeFilter.endsWith(']')) {
_feedbackTypeFilter = JSON.parse(feedbackTypeFilter)
}
if (_feedbackTypeFilter.length === 1) {