chore: init lms adm fe

This commit is contained in:
2026-07-07 17:23:40 +09:00
commit d682e9a382
57 changed files with 12065 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
export type InstructorCourse = {
id: string;
slug: string;
title: string;
subtitle?: string | null;
description?: string | null;
organizationName: string;
teacher?: {
id: string;
name?: string | null;
email: string;
};
};
const LMS_API_BASE_URL = (import.meta.env.VITE_API_BASE_URL ?? 'http://localhost:4400/api').replace(/\/+$/, '');
export async function listInstructorCourses(accessToken: string): Promise<{ courses: InstructorCourse[] }> {
const response = await fetch(`${LMS_API_BASE_URL}/instructor/courses`, {
headers: {
Authorization: `Bearer ${accessToken}`,
},
});
if (!response.ok) throw new Error(`강좌 목록을 불러오지 못했습니다. (${response.status})`);
return response.json() as Promise<{ courses: InstructorCourse[] }>;
}