chore: complete clean Agent Desk source snapshot
This commit is contained in:
21
web/lib/api/config.ts
Normal file
21
web/lib/api/config.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { request } from "@/lib/api/client"
|
||||
|
||||
export type PublicConfig = {
|
||||
language: string
|
||||
companyName?: string
|
||||
companyLogoUrl?: string
|
||||
passwordLoginEnabled?: boolean
|
||||
oidcEnabled: boolean
|
||||
}
|
||||
|
||||
let publicConfigPromise: Promise<PublicConfig> | null = null
|
||||
|
||||
export function fetchPublicConfig() {
|
||||
publicConfigPromise ??= request<PublicConfig>("/api/config", {
|
||||
skipAuth: true,
|
||||
}).catch((error) => {
|
||||
publicConfigPromise = null
|
||||
throw error
|
||||
})
|
||||
return publicConfigPromise
|
||||
}
|
||||
Reference in New Issue
Block a user