From 9282cde7cde2c0214950b3bc140d8e7181a6f840 Mon Sep 17 00:00:00 2001 From: Brian Rahadi Date: Tue, 8 Oct 2024 14:27:59 -0700 Subject: [PATCH] Revert "yolo" This reverts commit 695c68fb64d2f0b44b49bccc0601cb572ec9b6ae. --- pages/courses.tsx | 26 +------------------------- scripts/course-explorer-script | 2 +- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/pages/courses.tsx b/pages/courses.tsx index 727ebfb..fec7cf0 100644 --- a/pages/courses.tsx +++ b/pages/courses.tsx @@ -6,37 +6,13 @@ import { Course, Requirement, RequirementSchema } from "types/course"; import { z } from "zod"; import { SidebarCourse } from "components/SidebarCourse"; -const COURSES_JSON_URL = - "https://raw.githubusercontent.com/ssss-sfu/course-explorer-script/main/result/courses.json/"; - const Courses: React.FC = () => { // Parse the JSON data using Zod schemas const [courseShown, setCourseShown] = useState(null); const [requirements, setRequirements] = useState([]); useEffect(() => { - const fetchCourses = async () => { - try { - const response = await fetch(COURSES_JSON_URL, { - mode: "no-cors", - headers: { - "Content-Type": "application/json", - }, - }); - - // if (!response.ok) { - // throw new Error("Failed to fetch courses data"); - // } - const json = await response.json(); - // console.log(json); - // const coursesJson = await response.json(); - setRequirements(z.array(RequirementSchema).parse(json)); - } catch (error) { - console.error(error); - } - }; - - fetchCourses(); + setRequirements(z.array(RequirementSchema).parse(coursesJson)); }, []); return ( diff --git a/scripts/course-explorer-script b/scripts/course-explorer-script index bc7b5f1..579a5f1 160000 --- a/scripts/course-explorer-script +++ b/scripts/course-explorer-script @@ -1 +1 @@ -Subproject commit bc7b5f1c759b8978b9b370ab5765dad616043cf9 +Subproject commit 579a5f1c636777a9ac072f13c89f6bd3ff7a2234