Files
supabase/apps/studio/data/content/keys.ts
Kevin Grüneberg 312259b704 chore: user v2 content count query for search (#39869)
* chore: user v2 content count query for search

Instead of using two different endpoint versions, we can rely on v2 for all cases.

* Update SearchList.tsx
2025-10-26 13:49:33 +08:00

46 lines
1.5 KiB
TypeScript

export const contentKeys = {
allContentLists: (projectRef: string | undefined) => ['projects', projectRef, 'content'] as const,
infiniteList: (
projectRef: string | undefined,
options?: {
type: string
name: string | undefined
limit?: number
sort?: string
}
) => ['projects', projectRef, 'content-infinite', options].filter(Boolean),
list: (
projectRef: string | undefined,
options: { type?: string; name?: string; limit?: number }
) => ['projects', projectRef, 'content', options] as const,
sqlSnippets: (
projectRef: string | undefined,
options?: {
sort?: 'inserted_at' | 'name'
name?: string
visibility?: string
favorite?: boolean
}
) => ['projects', projectRef, 'content', 'sql', options].filter(Boolean),
folders: (
projectRef: string | undefined,
options?: { sort?: 'inserted_at' | 'name'; name?: string }
) => ['projects', projectRef, 'content', 'folders', options].filter(Boolean),
folderContents: (
projectRef: string | undefined,
id?: string,
options?: { sort?: 'inserted_at' | 'name'; name?: string }
) => ['projects', projectRef, 'content', 'folders', id, options].filter(Boolean),
resource: (projectRef: string | undefined, id?: string) =>
['projects', projectRef, 'content-id', id] as const,
count: (
projectRef: string | undefined,
type?: string,
options?: {
visibility?: string
favorite?: boolean
name?: string
}
) => ['projects', projectRef, 'content', 'count', type, options].filter(Boolean),
}