From 3976984f14141dbb59fcdc84e7050e2cfa77cd61 Mon Sep 17 00:00:00 2001 From: skoriop Date: Mon, 29 Jul 2024 18:26:11 +0530 Subject: [PATCH] fix: fix search service url --- backend/src/controllers/timetable/searchTimetable.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/controllers/timetable/searchTimetable.ts b/backend/src/controllers/timetable/searchTimetable.ts index d66b71d..6795270 100644 --- a/backend/src/controllers/timetable/searchTimetable.ts +++ b/backend/src/controllers/timetable/searchTimetable.ts @@ -66,7 +66,6 @@ export const searchTimetable = async (req: Request, res: Response) => { } = req.query; const usefulQueryParams = { - query, from, year, name, @@ -78,16 +77,16 @@ export const searchTimetable = async (req: Request, res: Response) => { instructor: instructorQuery, }; - let searchServiceURL = `${env.SEARCH_SERVICE_URL}/timetable/search`; + let searchServiceURL = `${env.SEARCH_SERVICE_URL}/timetable/search?query=${query}`; for (const [key, value] of Object.entries(usefulQueryParams)) { if (value === undefined) continue; if (Array.isArray(value)) { for (const v of value) { - searchServiceURL += `?${key}=${v}`; + searchServiceURL += `&${key}=${v}`; } } else { - searchServiceURL += `?${key}=${value}`; + searchServiceURL += `&${key}=${value}`; } }