icssc / peterportal-public-api

API that provides easy-access to UC Irvine data such as: courses, professors, grade distribution, schedule of classes, and more
https://api.peterportal.org/
MIT License
23 stars 11 forks source link

Added dash to allowed instructor characters #210

Closed ramanxg closed 2 years ago

ramanxg commented 2 years ago

Reference Issues

An issue was discovered in PeterPortal where going to wong-ma would break, since the gradeData could not be fetched. image

Summary of Change/Fix

The problem was that since there is a dash in the name, it wouldn't pass the check for syntax so it would fail and return a 400. Added a dash to the accepted characters in regex.

Test Plan

{
  grades (instructor:"WONG-MA, J."){
    aggregate {
      sum_grade_a_count
      sum_grade_b_count
      sum_grade_c_count
      sum_grade_d_count
      sum_grade_f_count
      sum_grade_p_count
      sum_grade_np_count
      average_gpa
    count
    }
  }
}