This commit is contained in:
2026-05-14 07:09:52 +06:00
parent edef0a70d2
commit abf4d41c23
18 changed files with 350 additions and 41 deletions

View File

@@ -15,15 +15,16 @@ export function qChatMessages() {
queryFn: async ({ pageParam }) => {
const response = await api.chad.chatMessages({ cursor: pageParam, limit: 30 })
return {
messages: response.data.messages.reverse(),
nextCursor: response.data.nextCursor,
}
return response.data
// return {
// messages: response.data.messages.reverse(),
// nextCursor: response.data.nextCursor,
// }
},
select: data => ({
pages: [...data.pages].reverse(),
pageParams: [...data.pageParams].reverse(),
}),
// select: data => ({
// pages: [...data.pages].reverse(),
// pageParams: [...data.pageParams].reverse(),
// }),
initialPageParam: undefined,
getNextPageParam: (lastPage) => {
return lastPage.nextCursor