platform/lms-adm-fe release promotion snapshot
This commit is contained in:
@@ -2,6 +2,8 @@ export type InstructorSubmissionCommitFile = {
|
||||
path: string;
|
||||
status: string;
|
||||
patch: string;
|
||||
originalRef?: string | null;
|
||||
modifiedRef?: string | null;
|
||||
};
|
||||
|
||||
export type InstructorSubmissionCommit = {
|
||||
@@ -30,12 +32,14 @@ export type InstructorSubmissionItem = {
|
||||
id: string;
|
||||
week: number;
|
||||
title: string;
|
||||
isTeamProject: boolean;
|
||||
};
|
||||
module: {
|
||||
id: string;
|
||||
name: string;
|
||||
folderName: string;
|
||||
sortOrder: number;
|
||||
sourceType?: 'CUSTOM' | 'GIT';
|
||||
};
|
||||
student: {
|
||||
id: string;
|
||||
@@ -43,6 +47,17 @@ export type InstructorSubmissionItem = {
|
||||
email: string;
|
||||
group: string;
|
||||
};
|
||||
team?: {
|
||||
id: string;
|
||||
name: string;
|
||||
members: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
commitCount: number;
|
||||
lastCommittedAt: string | null;
|
||||
}>;
|
||||
} | null;
|
||||
repository: {
|
||||
id: string;
|
||||
owner: string;
|
||||
@@ -73,6 +88,7 @@ export type InstructorSubmissionsResponse = {
|
||||
id: string;
|
||||
week: number;
|
||||
title: string;
|
||||
isTeamProject: boolean;
|
||||
modules: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -88,6 +104,7 @@ export type InstructorSubmissionsResponse = {
|
||||
group: string;
|
||||
}>;
|
||||
items: InstructorSubmissionItem[];
|
||||
teamItems: InstructorSubmissionItem[];
|
||||
};
|
||||
|
||||
const LMS_API_BASE_URL = (import.meta.env.VITE_API_BASE_URL ?? 'https://workspace.autonomystudio.net/lms-api/api').replace(/\/+$/, '');
|
||||
@@ -106,6 +123,45 @@ export async function listInstructorSubmissions(accessToken: string): Promise<In
|
||||
return response.json() as Promise<InstructorSubmissionsResponse>;
|
||||
}
|
||||
|
||||
export async function getInstructorSubmissionFile(
|
||||
accessToken: string,
|
||||
input: {
|
||||
owner: string;
|
||||
repoName: string;
|
||||
path: string;
|
||||
baseRef?: string | null;
|
||||
headRef?: string | null;
|
||||
},
|
||||
): Promise<{
|
||||
original: string;
|
||||
modified: string;
|
||||
originalAvailable: boolean;
|
||||
modifiedAvailable: boolean;
|
||||
}> {
|
||||
const query = new URLSearchParams({
|
||||
owner: input.owner,
|
||||
repo: input.repoName,
|
||||
path: input.path,
|
||||
});
|
||||
if (input.baseRef) query.set('baseRef', input.baseRef);
|
||||
if (input.headRef) query.set('headRef', input.headRef);
|
||||
|
||||
const response = await fetch(`${LMS_API_BASE_URL}/instructor/submissions/file?${query.toString()}`, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${accessToken}`,
|
||||
},
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`파일 내용을 불러오지 못했습니다. (${response.status})`);
|
||||
}
|
||||
return response.json() as Promise<{
|
||||
original: string;
|
||||
modified: string;
|
||||
originalAvailable: boolean;
|
||||
modifiedAvailable: boolean;
|
||||
}>;
|
||||
}
|
||||
|
||||
export async function saveInstructorSubmissionScore(
|
||||
accessToken: string,
|
||||
input: { studentId: string; weekId: string; score: number },
|
||||
|
||||
Reference in New Issue
Block a user