From 5df34bdce4f82df517b23736b5f21ae138522da8 Mon Sep 17 00:00:00 2001
From: Matthew Rowland
Date: Sun, 27 Oct 2024 15:10:49 -0700
Subject: [PATCH] chore: Fix grade distributions for now
---
.../modules/grade-distribution/controller.ts | 20 +++++++++----------
.../Schedule/Editor/SideBar/Class/index.tsx | 5 ++---
turbo.json | 2 +-
3 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/apps/backend/src/modules/grade-distribution/controller.ts b/apps/backend/src/modules/grade-distribution/controller.ts
index b871fbea3..3acc77f8c 100644
--- a/apps/backend/src/modules/grade-distribution/controller.ts
+++ b/apps/backend/src/modules/grade-distribution/controller.ts
@@ -169,8 +169,8 @@ export const getGradeDistributionByCourse = async (
subject,
});
- if (distributions.length === 0)
- throw new Error("No grade distributions found");
+ // if (distributions.length === 0)
+ // throw new Error("No grade distributions found");
const distribution = getDistribution(distributions);
@@ -205,8 +205,8 @@ export const getGradeDistributionByClass = async (
classNumber: section.id,
});
- if (distributions.length === 0)
- throw new Error("No grade distributions found");
+ // if (distributions.length === 0)
+ // throw new Error("No grade distributions found");
const distribution = getDistribution(distributions);
@@ -233,8 +233,8 @@ export const getGradeDistributionBySemester = async (
termId: term.id,
});
- if (distributions.length === 0)
- throw new Error("No grade distributions found");
+ // if (distributions.length === 0)
+ // throw new Error("No grade distributions found");
const distribution = getDistribution(distributions);
@@ -264,8 +264,8 @@ export const getGradeDistributionByInstructor = async (
classNumber: { $in: sections.map((section) => section.id) },
});
- if (distributions.length === 0)
- throw new Error("No grade distributions found");
+ // if (distributions.length === 0)
+ // throw new Error("No grade distributions found");
const distribution = getDistribution(distributions);
@@ -300,8 +300,8 @@ export const getGradeDistributionByInstructorAndSemester = async (
classNumber: { $in: sections.map((section) => section.id) },
});
- if (distributions.length === 0)
- throw new Error("No grade distributions found");
+ // if (distributions.length === 0)
+ // throw new Error("No grade distributions found");
const distribution = getDistribution(distributions);
diff --git a/apps/frontend/src/app/Schedule/Editor/SideBar/Class/index.tsx b/apps/frontend/src/app/Schedule/Editor/SideBar/Class/index.tsx
index e9257985e..59d55c38a 100644
--- a/apps/frontend/src/app/Schedule/Editor/SideBar/Class/index.tsx
+++ b/apps/frontend/src/app/Schedule/Editor/SideBar/Class/index.tsx
@@ -2,7 +2,6 @@ import { useMemo } from "react";
import { ArrowSeparateVertical, ArrowUnionVertical } from "iconoir-react";
-import AverageGrade from "@/components/AverageGrade";
import Capacity from "@/components/Capacity";
import Units from "@/components/Units";
import { Component, IClass, componentMap } from "@/lib/api";
@@ -72,9 +71,9 @@ export default function Class({
{_class.title ?? _class.course.title}