We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, these sections of code are shared between the grades and websoc services:
grades
websoc
if (input.courseNumber) { const courseNumberConditions: Array<SQL | undefined> = []; for (const num of input.courseNumber) { switch (num._type) { case "ParsedInteger": courseNumberConditions.push(eq(websocCourse.courseNumeric, num.value)); break; case "ParsedString": courseNumberConditions.push(eq(websocCourse.courseNumber, num.value)); break; case "ParsedRange": courseNumberConditions.push( and(gte(websocCourse.courseNumeric, num.min), lte(websocCourse.courseNumeric, num.max)), ); break; } } conditions.push(or(...courseNumberConditions)); }
if (input.division) { switch (input.division) { case "LowerDiv": conditions.push( and(gte(websocCourse.courseNumeric, 1), lte(websocCourse.courseNumeric, 99)), ); break; case "UpperDiv": conditions.push( and(gte(websocCourse.courseNumeric, 100), lte(websocCourse.courseNumeric, 199)), ); break; case "Graduate": conditions.push(gte(websocCourse.courseNumeric, 200)); break; } }
if (input.ge) { switch (input.ge) { case "GE-1A": conditions.push(isTrue(websocCourse.isGE1A)); break; case "GE-1B": conditions.push(isTrue(websocCourse.isGE1B)); break; case "GE-2": conditions.push(isTrue(websocCourse.isGE2)); break; case "GE-3": conditions.push(isTrue(websocCourse.isGE3)); break; case "GE-4": conditions.push(isTrue(websocCourse.isGE4)); break; case "GE-5A": conditions.push(isTrue(websocCourse.isGE5A)); break; case "GE-5B": conditions.push(isTrue(websocCourse.isGE5B)); break; case "GE-6": conditions.push(isTrue(websocCourse.isGE6)); break; case "GE-7": conditions.push(isTrue(websocCourse.isGE7)); break; case "GE-8": conditions.push(isTrue(websocCourse.isGE8)); break; } }
It would be good to consolidate them to be reusable.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, these sections of code are shared between the
grades
andwebsoc
services:It would be good to consolidate them to be reusable.
The text was updated successfully, but these errors were encountered: