RezinaLMS-Admin/src/lib/personasErrors.ts
Yared Yemane 2966bdb180 feat(admin): connect admin pages to live APIs and expand content tooling
Wire team, user, persona, FAQ, and ratings flows to backend endpoints; rebuild profile and user detail views with learning activity and subscriptions; fetch Vimeo lesson duration on module cards; add shared filters, permissions helpers, and notification UX improvements.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-14 05:49:36 -07:00

13 lines
502 B
TypeScript

export function getPersonaApiErrorMessage(error: unknown, fallback: string): string {
const data = (error as { response?: { data?: { message?: string; error?: string } } })
?.response?.data
return data?.error ?? data?.message ?? fallback
}
export function isPersonaForbiddenError(error: unknown): boolean {
return (error as { response?: { status?: number } })?.response?.status === 403
}
export const PERSONAS_FORBIDDEN_MESSAGE =
"You don't have permission to access the persona catalog"