add commits..

This commit is contained in:
2026-08-12 14:46:19 +09:00
parent 4869dbe4c1
commit 2a3e2ead65
2 changed files with 76 additions and 1 deletions
+17
View File
@@ -24,3 +24,20 @@ export async function listInstructorCourses(accessToken: string): Promise<{ cour
if (!response.ok) throw new Error(`강좌 목록을 불러오지 못했습니다. (${response.status})`);
return response.json() as Promise<{ courses: InstructorCourse[] }>;
}
export async function createInitialInstructorCourse(accessToken: string, title: string): Promise<{ course: InstructorCourse }> {
const response = await fetch(`${LMS_API_BASE_URL}/instructor/courses/initial`, {
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ title }),
});
if (!response.ok) {
const payload = await response.json().catch(() => null) as { message?: string } | null;
throw new Error(payload?.message || `강좌를 생성하지 못했습니다. (${response.status})`);
}
return response.json() as Promise<{ course: InstructorCourse }>;
}