Skip to content

Commit

Permalink
Bugfix/delete messages via sessionId (#3982)
Browse files Browse the repository at this point in the history
delete messages via sessionId
  • Loading branch information
HenryHengZJ authored Feb 4, 2025
1 parent a0b4abd commit 01cb3ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/server/src/controllers/chat-messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ const removeAllChatMessages = async (req: Request, res: Response, next: NextFunc
const messages = await utilGetChatMessage({
chatflowid,
chatTypes,
sessionId,
startDate,
endDate,
feedback: isFeedback,
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/ui-component/dialog/ViewMessagesDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ 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) {
obj.chatType = _chatTypeFilter[0]
}

let _feedbackTypeFilter = feedbackTypeFilter
if (typeof feedbackTypeFilter === 'string') {
if (typeof feedbackTypeFilter === 'string' && feedbackTypeFilter.startsWith('[') && feedbackTypeFilter.endsWith(']')) {
_feedbackTypeFilter = JSON.parse(feedbackTypeFilter)
}
if (_feedbackTypeFilter.length === 1) {
Expand Down

0 comments on commit 01cb3ef

Please sign in to comment.