fix: search with 'ё' like 'е'

This commit is contained in:
Polianin Nikita 2024-08-28 20:13:30 +03:00
parent b341d66f08
commit 9d9302525b

View File

@ -78,8 +78,8 @@ export class ProfessorComponent implements OnInit, IScheduleTab {
if (value === '') if (value === '')
return []; return [];
const filterValue = value.toLowerCase(); const filterValue = value.toLowerCase().replace('ё', 'е');
return this.professors?.filter(teacher => teacher.name.toLowerCase().includes(filterValue)) ?? []; return this.professors?.filter(teacher => teacher.name.toLowerCase().replace('ё', 'е').includes(filterValue)) ?? [];
} else { } else {
const selectedTeacher = this.professors?.find(teacher => teacher.id === value); const selectedTeacher = this.professors?.find(teacher => teacher.id === value);
return selectedTeacher ? [selectedTeacher] : []; return selectedTeacher ? [selectedTeacher] : [];