This commit is contained in:
2026-08-03 13:58:20 +09:00
parent ab40abf5b3
commit def692a28b
8 changed files with 609 additions and 59 deletions
+20
View File
@@ -99,6 +99,11 @@ export type InstructorPlatformsResponse = {
agents: TeachingAgent[];
};
export type InstructorPlatformRegistrationResponse = {
code: string;
expiresAt: string | null;
};
const LMS_API_BASE_URL = (import.meta.env.VITE_API_BASE_URL ?? 'https://workspace.autonomystudio.net/lms-api/api').replace(/\/+$/, '');
export async function listInstructorPlatforms(accessToken: string): Promise<InstructorPlatformsResponse> {
@@ -158,6 +163,21 @@ export async function createInstructorPlatform(
return response.json() as Promise<InstructorPlatformsResponse>;
}
export async function issueInstructorPlatformRegistration(
accessToken: string,
): Promise<InstructorPlatformRegistrationResponse> {
const response = await fetch(`${LMS_API_BASE_URL}/instructor/platform-registration-code`, {
method: 'POST',
headers: {
Authorization: `Bearer ${accessToken}`,
'content-type': 'application/json',
},
});
if (!response.ok) throw new Error(await platformErrorMessage(response, '등록 키를 발급하지 못했습니다.'));
return response.json() as Promise<InstructorPlatformRegistrationResponse>;
}
export async function updateInstructorPlatform(
accessToken: string,
platformId: string,