Skip to content

Commit

Permalink
fix: minor nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
skoriop committed Jul 24, 2024
1 parent e23e690 commit 3390ba2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions backend/src/controllers/timetable/searchTimetable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export const searchTimetable = async (req: Request, res: Response) => {
headers: { "Content-Type": "application/json" },
});

let timetables = await response.json();
const searchResults = await response.json();

if (!response.ok) {
console.log("Error while searching timetable: ", timetables.error);
console.log("Error while searching timetable: ", searchResults.error);
return res.status(500).json({ message: "Internal Server Error" });
}

timetables = timetables.map(
const timetables = searchResults.map(
(el: { timetable: Timetable; score: string }) => el.timetable,
);

Expand Down
4 changes: 2 additions & 2 deletions backend/src/controllers/timetable/updateChangedTimetable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ export const updateChangedTimetable = async (req: Request, res: Response) => {
console.log("Error while adding course to search service: ", err.message);
return res.status(500).json({ message: "Internal Server Error" });
}
// update timetables in search service

// update timetables in search service
for (const timetable of timetables) {
try {
const searchServiceURL = `${env.SEARCH_SERVICE_URL}/timetable/remove`;
Expand Down Expand Up @@ -316,8 +316,8 @@ export const updateChangedTimetable = async (req: Request, res: Response) => {
},
body: JSON.stringify(timetableWithSectionsString),
});
const resJson = await res.json();
if (!res.ok) {
const resJson = await res.json();
console.log(resJson.error);
}
} catch (err: any) {
Expand Down

0 comments on commit 3390ba2

Please sign in to comment.