feat: let students customize public profiles
All checks were successful
CI / Validate frontend and API (push) Successful in 1m2s
CI / Build and publish Docker images (push) Successful in 23s

This commit is contained in:
Cauê Faleiros
2026-09-08 14:46:16 -03:00
parent ad736758a7
commit 54f598cd99
7 changed files with 54 additions and 38 deletions

View File

@@ -210,6 +210,7 @@ export const getCourses = async (): Promise<Course[]> => {
export type InstructorProfileData = {
id: string;
name: string;
role: 'student' | 'instructor' | 'admin';
avatarImageUrl: string | null;
headline: string;
bio: string;
@@ -225,6 +226,11 @@ export const getInstructorProfile = async (instructorId: string): Promise<Instru
return { ...response.data, courses: response.data.courses.map(toCourse) };
};
export const getPublicProfile = async (profileId: string): Promise<InstructorProfileData> => {
const response = await apiRequest<{ data: Omit<InstructorProfileData, 'courses'> & { courses: ApiCourse[] } }>(`/profiles/${profileId}`);
return { ...response.data, courses: response.data.courses.map(toCourse) };
};
export const getLearningPaths = async (): Promise<PublicLearningPath[]> => {
const response = await apiRequest<{ data: PublicLearningPath[] }>('/courses/paths');
return response.data;