Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

fix(websoc): 🐛 correct fullCourses options #139

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/api/src/routes/v1/rest/websoc/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,16 @@ export function constructPrismaQuery(parsedQuery: Query): Prisma.WebsocSectionWh
if (parsedQuery.fullCourses && parsedQuery.fullCourses !== "ANY") {
switch (parsedQuery.fullCourses) {
case "FullOnly":
AND.push({ sectionFull: true, waitlistFull: true });
AND.push({ sectionFull: true }, { waitlistFull: true });
break;
case "OverEnrolled":
case "Overenrolled":
AND.push({ overEnrolled: true });
break;
case "SkipFull":
AND.push({ sectionFull: true, waitlistFull: false });
AND.push({ sectionFull: false });
break;
case "SkipFullWaitlist":
AND.push({ sectionFull: false, waitlistFull: false });
AND.push({ sectionFull: true }, { waitlistFull: false });
}
}

Expand Down
2 changes: 1 addition & 1 deletion libs/uc-irvine-lib/src/websoc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const fullCoursesOptions = [
"SkipFull",
"SkipFullWaitlist",
"FullOnly",
"OverEnrolled",
"Overenrolled",
] as const;

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/types/types/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const fullCoursesOptions = [
"SkipFull",
"SkipFullWaitlist",
"FullOnly",
"OverEnrolled",
"Overenrolled",
] as const;
/**
* The list of options for filtering cancelled courses.
Expand Down
Loading