mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 03:01:10 +03:00
Merge branch 'main' into bugfix/chatmessage-query-by-chatId-memoryType-isNull-where
This commit is contained in:
@@ -511,6 +511,7 @@ export class App {
|
|||||||
const chatId = req.query?.chatId as string | undefined
|
const chatId = req.query?.chatId as string | undefined
|
||||||
const memoryType = req.query?.memoryType as string | undefined
|
const memoryType = req.query?.memoryType as string | undefined
|
||||||
const sessionId = req.query?.sessionId as string | undefined
|
const sessionId = req.query?.sessionId as string | undefined
|
||||||
|
const messageId = req.query?.messageId as string | undefined
|
||||||
const startDate = req.query?.startDate as string | undefined
|
const startDate = req.query?.startDate as string | undefined
|
||||||
const endDate = req.query?.endDate as string | undefined
|
const endDate = req.query?.endDate as string | undefined
|
||||||
let chatTypeFilter = req.query?.chatType as chatType | undefined
|
let chatTypeFilter = req.query?.chatType as chatType | undefined
|
||||||
@@ -538,7 +539,8 @@ export class App {
|
|||||||
memoryType,
|
memoryType,
|
||||||
sessionId,
|
sessionId,
|
||||||
startDate,
|
startDate,
|
||||||
endDate
|
endDate,
|
||||||
|
messageId
|
||||||
)
|
)
|
||||||
return res.json(chatmessages)
|
return res.json(chatmessages)
|
||||||
})
|
})
|
||||||
@@ -1440,7 +1442,8 @@ export class App {
|
|||||||
memoryType?: string,
|
memoryType?: string,
|
||||||
sessionId?: string,
|
sessionId?: string,
|
||||||
startDate?: string,
|
startDate?: string,
|
||||||
endDate?: string
|
endDate?: string,
|
||||||
|
messageId?: string
|
||||||
): Promise<ChatMessage[]> {
|
): Promise<ChatMessage[]> {
|
||||||
const setDateToStartOrEndOfDay = (dateTimeStr: string, setHours: 'start' | 'end') => {
|
const setDateToStartOrEndOfDay = (dateTimeStr: string, setHours: 'start' | 'end') => {
|
||||||
const date = new Date(dateTimeStr)
|
const date = new Date(dateTimeStr)
|
||||||
@@ -1465,7 +1468,8 @@ export class App {
|
|||||||
memoryType: memoryType ?? undefined,
|
memoryType: memoryType ?? undefined,
|
||||||
sessionId: sessionId ?? undefined,
|
sessionId: sessionId ?? undefined,
|
||||||
...(fromDate && { createdDate: MoreThanOrEqual(fromDate) }),
|
...(fromDate && { createdDate: MoreThanOrEqual(fromDate) }),
|
||||||
...(toDate && { createdDate: LessThanOrEqual(toDate) })
|
...(toDate && { createdDate: LessThanOrEqual(toDate) }),
|
||||||
|
id: messageId ?? undefined
|
||||||
},
|
},
|
||||||
order: {
|
order: {
|
||||||
createdDate: sortOrder === 'DESC' ? 'DESC' : 'ASC'
|
createdDate: sortOrder === 'DESC' ? 'DESC' : 'ASC'
|
||||||
|
|||||||
Reference in New Issue
Block a user