feat(chat): implement pull-to-refresh functionality and pagination for chat history
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { ChatHistoryResponse } from "@/data/dto/chat";
|
||||
|
||||
describe("ChatHistoryResponse", () => {
|
||||
it("exposes the pagination total and limit used by chat history", () => {
|
||||
const response = ChatHistoryResponse.from({
|
||||
messages: [],
|
||||
total: 120,
|
||||
limit: 50,
|
||||
offset: 0,
|
||||
});
|
||||
|
||||
expect(response.total).toBe(120);
|
||||
expect(response.limit).toBe(50);
|
||||
});
|
||||
});
|
||||
@@ -10,6 +10,8 @@ import { ChatMessage } from "../chat_message";
|
||||
|
||||
export class ChatHistoryResponse {
|
||||
declare readonly messages: ChatMessage[];
|
||||
declare readonly total: number;
|
||||
declare readonly limit: number;
|
||||
|
||||
private constructor(input: ChatHistoryResponseInput) {
|
||||
const data = ChatHistoryResponseSchema.parse(input);
|
||||
|
||||
Reference in New Issue
Block a user