mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
Update branding.ts
This commit is contained in:
@@ -15,6 +15,10 @@ export interface FullscreenEnabled {
|
|||||||
enabled: boolean
|
enabled: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface EmailAuthEnabled {
|
||||||
|
enabled: boolean
|
||||||
|
}
|
||||||
|
|
||||||
const BRANDING_CACHE_KEY = 'cabinet_branding'
|
const BRANDING_CACHE_KEY = 'cabinet_branding'
|
||||||
const LOGO_PRELOADED_KEY = 'cabinet_logo_preloaded'
|
const LOGO_PRELOADED_KEY = 'cabinet_logo_preloaded'
|
||||||
|
|
||||||
@@ -157,4 +161,21 @@ export const brandingApi = {
|
|||||||
const response = await apiClient.patch<FullscreenEnabled>('/cabinet/branding/fullscreen', { enabled })
|
const response = await apiClient.patch<FullscreenEnabled>('/cabinet/branding/fullscreen', { enabled })
|
||||||
return response.data
|
return response.data
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Get email auth enabled (public, no auth required)
|
||||||
|
getEmailAuthEnabled: async (): Promise<EmailAuthEnabled> => {
|
||||||
|
try {
|
||||||
|
const response = await apiClient.get<EmailAuthEnabled>('/cabinet/branding/email-auth')
|
||||||
|
return response.data
|
||||||
|
} catch {
|
||||||
|
// If endpoint doesn't exist, default to enabled
|
||||||
|
return { enabled: true }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Update email auth enabled (admin only)
|
||||||
|
updateEmailAuthEnabled: async (enabled: boolean): Promise<EmailAuthEnabled> => {
|
||||||
|
const response = await apiClient.patch<EmailAuthEnabled>('/cabinet/branding/email-auth', { enabled })
|
||||||
|
return response.data
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user