Skip to content

Commit 98132fb

Browse files
committed
Fix bad merge
1 parent b39aa85 commit 98132fb

File tree

1 file changed

+12
-8
lines changed
  • app/course/[course_id]/assignments/[assignment_id]/submissions/[submissions_id]

1 file changed

+12
-8
lines changed

app/course/[course_id]/assignments/[assignment_id]/submissions/[submissions_id]/layout.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
import { Button } from "@/components/ui/button";
33
import { PopoverArrow, PopoverBody, PopoverContent, PopoverRoot, PopoverTrigger } from "@/components/ui/popover";
44
import {
5-
SubmissionWithGraderResultsAndErrors,
65
SubmissionWithGraderResultsAndFiles,
76
SubmissionWithGraderResultsAndReview
87
} from "@/utils/supabase/DatabaseTypes";
8+
import { Database } from "@/utils/supabase/SupabaseTypes";
9+
import { UnstableGetResult as GetResult } from "@supabase/postgrest-js";
910
import { Box, Flex, Heading, HStack, List, Skeleton, Table, Text, VStack } from "@chakra-ui/react";
1011

1112
import { AdjustDueDateDialog } from "@/app/course/[course_id]/manage/assignments/[assignment_id]/due-date-exceptions/page";
@@ -259,16 +260,19 @@ function SubmissionReviewScoreTweak() {
259260
}
260261
// Select query for full submission data with grader results, test outputs, and files
261262
const FULL_SUBMISSION_SELECT =
262-
"*, grader_results(*, grader_result_tests(*, grader_result_test_output(*)), grader_result_output(*)), submission_reviews!submissions_grading_review_id_fkey(*), repository_check_runs!submissions_repository_check_run_id_fkey(commit_message), submission_files(name, contents)";
263+
"*, grader_results!grader_results_submission_id_fkey(*, grader_result_tests(*, grader_result_test_output(*)), grader_result_output(*)), submission_reviews!submissions_grading_review_id_fkey(*), repository_check_runs!submissions_repository_check_run_id_fkey(commit_message), submission_files(name, contents)";
263264

264-
type SubmissionFileBasic = { name: string; contents: string | null };
265+
// Type that matches the FULL_SUBMISSION_SELECT query result
266+
type FullSubmissionQueryResult = GetResult<
267+
Database["public"],
268+
Database["public"]["Tables"]["submissions"]["Row"],
269+
"submissions",
270+
Database["public"]["Tables"]["submissions"]["Relationships"],
271+
"*, grader_results!grader_results_submission_id_fkey(*, grader_result_tests(*, grader_result_test_output(*)), grader_result_output(*)), submission_reviews!submissions_grading_review_id_fkey(*), repository_check_runs!submissions_repository_check_run_id_fkey(commit_message), submission_files(name, contents)"
272+
>;
265273

266274
// Use Omit to avoid implying assignments/workflow_run_error are populated (they aren't in our query)
267-
type FullSubmissionData = Omit<SubmissionWithGraderResultsAndErrors, "assignments" | "workflow_run_error"> & {
268-
submission_reviews: SubmissionWithGraderResultsAndReview["submission_reviews"];
269-
repository_check_runs: { commit_message: string } | null;
270-
submission_files: SubmissionFileBasic[] | null;
271-
};
275+
type FullSubmissionData = FullSubmissionQueryResult;
272276

273277
// Simple diff generator that shows added/removed lines between two strings
274278
function generateSimpleDiff(oldContent: string | null, newContent: string | null): string {

0 commit comments

Comments
 (0)