feat: add public instructor profiles
This commit is contained in:
@@ -10,6 +10,23 @@ export interface ApiUser {
|
||||
role: ApiRole;
|
||||
}
|
||||
|
||||
export interface Profile {
|
||||
id: string;
|
||||
email?: string;
|
||||
name: string;
|
||||
role: ApiRole;
|
||||
avatarImageUrl: string | null;
|
||||
headline: string;
|
||||
bio: string;
|
||||
websiteUrl: string | null;
|
||||
linkedinUrl: string | null;
|
||||
instagramUrl: string | null;
|
||||
youtubeUrl: string | null;
|
||||
isPublic: boolean;
|
||||
}
|
||||
|
||||
export type ProfileInput = Omit<Profile, 'id' | 'email' | 'role'>;
|
||||
|
||||
export interface ManagedUser {
|
||||
id: string;
|
||||
email: string;
|
||||
@@ -188,6 +205,12 @@ export const adminApi = {
|
||||
async updateHomeConfiguration(input: { featuredCourseId: string | null; courseOrder: string[]; defaultCoverImageUrl: string | null }) { return apiRequest<{ data: typeof input }>('/admin/home-configuration', { method: 'PUT', body: JSON.stringify(input) }); },
|
||||
};
|
||||
|
||||
export const profileApi = {
|
||||
async me() { return apiRequest<{ data: Profile }>('/profiles/me'); },
|
||||
async update(input: ProfileInput) { return apiRequest<{ data: Profile }>('/profiles/me', { method: 'PATCH', body: JSON.stringify(input) }); },
|
||||
async instructor(instructorId: string) { return apiRequest<{ data: Profile & { courses: unknown[] } }>(`/profiles/instructors/${instructorId}`); },
|
||||
};
|
||||
|
||||
export const instructorApi = {
|
||||
async analytics() { return apiRequest<{ data: InstructorAnalytics }>('/manage/courses/analytics'); },
|
||||
async bunnyConfiguration() { return apiRequest<{ data: { configured: boolean; maxUploadBytes: number } }>('/manage/media/bunny/config'); },
|
||||
|
||||
Reference in New Issue
Block a user