Function
getChatMessagesApiPath
({
chatId,
ordering = {
orderBy: "createdAt",
order: "asc",
},
pagination = {
page: 1,
pageSize: 10,
},
}: {
chatId: Id<ChatResponse>;
ordering?: OrderingParams;
pagination?: PaginationParams;
})
Source from the content-addressed store, hash-verified
| 120 | }; |
| 121 | |
| 122 | export const getChatMessagesApiPath = ({ |
| 123 | chatId, |
| 124 | ordering = { |
| 125 | orderBy: "createdAt", |
| 126 | order: "asc", |
| 127 | }, |
| 128 | pagination = { |
| 129 | page: 1, |
| 130 | pageSize: 10, |
| 131 | }, |
| 132 | }: { |
| 133 | chatId: Id<ChatResponse>; |
| 134 | ordering?: OrderingParams; |
| 135 | pagination?: PaginationParams; |
| 136 | }): string => { |
| 137 | return `/api/chats/${chatId}/messages?orderBy=${ordering.orderBy}&order=${ordering.order}&page=${pagination.page}&pageSize=${pagination.pageSize}`; |
| 138 | }; |
| 139 | |
| 140 | export const chatTitleApiPath = (chatId: Id<ChatResponse>): string => { |
| 141 | return `/api/chats/${chatId}/title`; |
Tested by
no test coverage detected