mirror of
https://github.com/supabase/supabase.git
synced 2026-05-30 17:32:00 +08:00
Chore/remove unpaginated projects endpoint from docs (#39771)
* Use paginated projects endpoint for docs * Deprecate old projects query * Fix * Fix * fix(docs branch selector) * refactor(docs project selector): simplify dom --------- Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import type { BranchesData } from '~/lib/fetch/branches'
|
||||
import type { OrganizationsData } from '~/lib/fetch/organizations'
|
||||
import type { ProjectsData } from '~/lib/fetch/projects'
|
||||
import { ProjectInfoInfinite } from '~/lib/fetch/projects-infinite'
|
||||
|
||||
export type Org = OrganizationsData[number]
|
||||
export type Project = ProjectsData[number]
|
||||
export type Branch = BranchesData[number]
|
||||
|
||||
export type Variable = 'url' | 'publishable' | 'anon' | 'sessionPooler'
|
||||
@@ -39,11 +38,17 @@ type DeepReadonly<T> = {
|
||||
readonly [P in keyof T]: DeepReadonly<T[P]>
|
||||
}
|
||||
|
||||
export function toDisplayNameOrgProject(org: DeepReadonly<Org>, project: DeepReadonly<Project>) {
|
||||
export function toDisplayNameOrgProject(
|
||||
org: DeepReadonly<Org>,
|
||||
project: DeepReadonly<ProjectInfoInfinite>
|
||||
) {
|
||||
return `${org.name} / ${project.name}`
|
||||
}
|
||||
|
||||
export function toOrgProjectValue(org: DeepReadonly<Org>, project: DeepReadonly<Project>) {
|
||||
export function toOrgProjectValue(
|
||||
org: DeepReadonly<Org>,
|
||||
project: DeepReadonly<ProjectInfoInfinite>
|
||||
) {
|
||||
return escapeDoubleQuotes(
|
||||
// @ts-ignore -- problem in OpenAPI spec -- project has ref property
|
||||
JSON.stringify([org.id, project.ref, removeDoubleQuotes(toDisplayNameOrgProject(org, project))])
|
||||
|
||||
Reference in New Issue
Block a user