From 28587068202ad8207457cdfbafb252652cdb4afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EB=8F=99=EC=9C=A8?= Date: Fri, 29 Nov 2024 16:37:52 +0900 Subject: [PATCH] =?UTF-8?q?[FE][Fix]=20=EA=B2=80=EC=83=89=20API=20URL=20?= =?UTF-8?q?=EC=88=AE=EC=96=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/component/searchbox/SearchBox.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/component/searchbox/SearchBox.tsx b/frontend/src/component/searchbox/SearchBox.tsx index 8d5d85a8..e9f94219 100644 --- a/frontend/src/component/searchbox/SearchBox.tsx +++ b/frontend/src/component/searchbox/SearchBox.tsx @@ -52,13 +52,13 @@ export const SearchBox = (props: ISearchBoxProps) => { setError(null); try { - const apiUrl = `https://cors-anywhere.herokuapp.com/https://openapi.naver.com/v1/search/local.json?query=${encodeURIComponent( - inputValue, - )}&display=5&start=1&sort=random`; - - // const apiUrl = `https://openapi.naver.com/v1/search/local.json?query=${encodeURIComponent( + // const apiUrl = `https://cors-anywhere.herokuapp.com/https://openapi.naver.com/v1/search/local.json?query=${encodeURIComponent( // inputValue, - // )}&display=10&start=1&sort=random`; + // )}&display=5&start=1&sort=random`; + + const apiUrl = `https://openapi.naver.com/v1/search/local.json?query=${encodeURIComponent( + inputValue, + )}&display=10&start=1&sort=random`; const response = await fetch(apiUrl, { headers: { @@ -130,7 +130,7 @@ export const SearchBox = (props: ISearchBoxProps) => { }, 300); // Todo : 요부분 반환값 lint 오류 때문에 해결이 안돼요... - // eslint-disable-next-line consistent-return + return () => { clearTimeout(delayDebounceFn); };