MCPcopy Index your code
hub / github.com/SecureAI-Tools/SecureAI-Tools / chatsApiPath

Function chatsApiPath

apps/web/lib/fe/api-paths.ts:21–45  ·  view source on GitHub ↗
({
  orgIdOrSlug,
  userId,
  ordering = {
    orderBy: "createdAt",
    order: "asc",
  },
  pagination = {
    page: 1,
    pageSize: 10,
  },
}: {
  orgIdOrSlug?: string;
  userId?: string;
  ordering?: OrderingParams;
  pagination?: PaginationParams;
})

Source from the content-addressed store, hash-verified

19};
20
21export 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
47export const chatApiPath = (chatId: Id<ChatResponse>): string => {
48 return `/api/chats/${chatId}`;

Callers 1

ChatHistoryFunction · 0.90

Calls 1

isEmptyFunction · 0.90

Tested by

no test coverage detected