Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const ProfessorHomeLayout = () => {
if (search.trim() === keyword) {
return;
}
navigate(`/professor/search/?keyword=${search}`);
navigate(`/professor/search/?keyword=${encodeURIComponent(search)}`);
}
} else if (event.key === 'Escape') {
event.currentTarget.blur();
Expand Down
11 changes: 7 additions & 4 deletions front-end/src/repository/courseRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,13 @@ class CourseRepository {
async searchCourses(keyword: string): Promise<CourseMeta[]> {
// API: GET /professors/courses?keyword={keyword}

const response = await fetch(`/api/professors/courses?keyword=${keyword}`, {
method: 'GET',
credentials: 'include',
});
const response = await fetch(
`/api/professors/courses?keyword=${encodeURIComponent(keyword)}`,
{
method: 'GET',
credentials: 'include',
}
);

await throwError(response);

Expand Down