patch..
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user