Files
supabase/apps/studio/data/projects/keys.ts
Joshen Lim 9efe2643e3 Joshen/fe 2141 swap organization settings page to use paginated projects (#40513)
* Use version 2 organization roles endpoint and fix all affected files + unit tests

* Update API codegen

* Replace all usage of old useProjectsQuery with useOrgProjectsInfiniteQuery

* Swap access callout for project roles to use collapsible instead

* Deprecate useProjectsQuery and clean up

* Update apps/studio/components/interfaces/Organization/TeamSettings/UpdateRolesPanel/UpdateRolesPanel.tsx

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>

---------

Co-authored-by: Alaister Young <alaister@users.noreply.github.com>
2025-11-18 13:26:09 +08:00

40 lines
1.8 KiB
TypeScript

export const INFINITE_PROJECTS_KEY_PREFIX = 'all-projects-infinite'
export const projectKeys = {
infiniteList: (params?: {
limit: number
sort?: 'name_asc' | 'name_desc' | 'created_asc' | 'created_desc'
search?: string
}) => [INFINITE_PROJECTS_KEY_PREFIX, params].filter(Boolean),
infiniteListByOrg: (
slug: string | undefined,
params?: {
limit: number
sort?: 'name_asc' | 'name_desc' | 'created_asc' | 'created_desc'
search?: string
statuses?: string[]
}
) => [INFINITE_PROJECTS_KEY_PREFIX, slug, params].filter(Boolean),
status: (projectRef: string | undefined) => ['project', projectRef, 'status'] as const,
types: (projectRef: string | undefined) => ['project', projectRef, 'types'] as const,
detail: (projectRef: string | undefined) => ['project', projectRef, 'detail'] as const,
serviceVersions: (projectRef: string | undefined) =>
['project', projectRef, 'service-versions'] as const,
readonlyStatus: (projectRef: string | undefined) =>
['projects', projectRef, 'readonly-status'] as const,
projectTransfer: (projectRef: string | undefined, targetOrganizationSlug: string | undefined) =>
['projects', 'transfer', projectRef, targetOrganizationSlug] as const,
projectTransferPreview: (
projectRef: string | undefined,
targetOrganizationSlug: string | undefined
) => ['projects', 'transfer', projectRef, targetOrganizationSlug, 'preview'] as const,
pauseStatus: (projectRef: string | undefined) =>
['projects', projectRef, 'pause-status'] as const,
// Clone to new project
listCloneBackups: (projectRef: string | undefined) =>
['projects', projectRef, 'clone-backups'] as const,
listCloneStatus: (projectRef: string | undefined) =>
['projects', projectRef, 'clone-status'] as const,
}