Skip to content
Snippets Groups Projects
Commit a81653c6 authored by Scott Berg's avatar Scott Berg
Browse files

Add Regex to check if user is searching for all subjects or if subjects is blank.

parent ae4d81b7
No related branches found
No related tags found
No related merge requests found
Pipeline #33508 passed
......@@ -131,8 +131,8 @@ export class CourseSearchComponent implements OnInit, OnDestroy {
(this.courseSearchForm.get(
'subject',
) as AbstractControl).valueChanges.subscribe(value => {
// If the subject value is blank, reset the filtered subjects
if (value === '') {
// If the subject value is blank, or if the user is typing "all"
if (new RegExp('^([Aa]?[Ll]{0,2})$').test(value.trim())) {
this.filteredSubjects = this.subjects;
return;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment