({
orgIdOrSlug,
userId,
ordering = {
orderBy: "createdAt",
order: "asc",
},
pagination = {
page: 1,
pageSize: 10,
},
}: {
orgIdOrSlug?: string;
userId?: string;
ordering?: OrderingParams;
pagination?: PaginationParams;
})
| 19 | }; |
| 20 | |
| 21 | export const chatsApiPath = ({ |
| 22 | orgIdOrSlug, |
| 23 | userId, |
| 24 | ordering = { |
| 25 | orderBy: "createdAt", |
| 26 | order: "asc", |
| 27 | }, |
| 28 | pagination = { |
| 29 | page: 1, |
| 30 | pageSize: 10, |
| 31 | }, |
| 32 | }: { |
| 33 | orgIdOrSlug?: string; |
| 34 | userId?: string; |
| 35 | ordering?: OrderingParams; |
| 36 | pagination?: PaginationParams; |
| 37 | }): string => { |
| 38 | return ( |
| 39 | `/api/chats?orderBy=${ordering.orderBy}&order=${ordering.order}&page=${pagination.page}&pageSize=${pagination.pageSize}` + |
| 40 | (!isEmpty(orgIdOrSlug) |
| 41 | ? `&orgIdOrSlug=${encodeURIComponent(orgIdOrSlug!)}` |
| 42 | : "") + |
| 43 | (!isEmpty(userId) ? `&userId=${encodeURIComponent(userId!)}` : "") |
| 44 | ); |
| 45 | }; |
| 46 | |
| 47 | export const chatApiPath = (chatId: Id<ChatResponse>): string => { |
| 48 | return `/api/chats/${chatId}`; |
no test coverage detected