diff --git a/apps/backend/apps/admin/src/submission/model/submission-detail.output.ts b/apps/backend/apps/admin/src/submission/model/submission-detail.output.ts index 8810be2cc8..41bf72ee1a 100644 --- a/apps/backend/apps/admin/src/submission/model/submission-detail.output.ts +++ b/apps/backend/apps/admin/src/submission/model/submission-detail.output.ts @@ -31,12 +31,8 @@ class TestCaseResult { @ObjectType() export class SubmissionDetail extends OmitType(Submission, [ - 'user', 'submissionResult', 'code', - 'problem', - 'contest', - 'workbook', '_count' ] as const) { @Field(() => String) @@ -44,7 +40,4 @@ export class SubmissionDetail extends OmitType(Submission, [ @Field(() => [TestCaseResult]) testcaseResult: TestCaseResult[] - - @Field(() => String, { nullable: true }) - username: string | null } diff --git a/apps/backend/apps/admin/src/submission/submission.service.ts b/apps/backend/apps/admin/src/submission/submission.service.ts index 5572b11073..89170b9f29 100644 --- a/apps/backend/apps/admin/src/submission/submission.service.ts +++ b/apps/backend/apps/admin/src/submission/submission.service.ts @@ -81,10 +81,12 @@ export class SubmissionService { }, include: { user: { - select: { - username: true + include: { + userProfile: true } }, + problem: true, + contest: true, submissionResult: true } }) @@ -103,14 +105,12 @@ export class SubmissionService { }) results.sort((a, b) => a.problemTestcaseId - b.problemTestcaseId) // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { submissionResult, user, ...submissionWithoutResultAndUser } = - submission + const { submissionResult, ...submissionWithoutResult } = submission return { - ...submissionWithoutResultAndUser, + ...submissionWithoutResult, code: code.map((snippet) => snippet.text).join('\n'), - testcaseResult: results, - username: submission.user?.username ?? null + testcaseResult: results } } } diff --git a/collection/admin/Submission/Get Submission Detail/Succeed.bru b/collection/admin/Submission/Get Submission Detail/Succeed.bru index 9081521737..84bd5c970c 100644 --- a/collection/admin/Submission/Get Submission Detail/Succeed.bru +++ b/collection/admin/Submission/Get Submission Detail/Succeed.bru @@ -38,7 +38,22 @@ body:graphql { createTime updateTime } - username + user { + id + studentId + userProfile { + realName + } + } + contest { + id + title + } + problem { + id + title + + } } }