diff --git a/FE/src/components/Search/index.tsx b/FE/src/components/Search/index.tsx index eaad617..248cd2b 100644 --- a/FE/src/components/Search/index.tsx +++ b/FE/src/components/Search/index.tsx @@ -41,7 +41,7 @@ export default function SearchModal() { // 결과가 없으면 변환된 검색어로 검색 if (originalResults.length === 0 && convertedSearch) { - return getSearchResults(formatNoSpecialChar(convertedSearch)); + return await getSearchResults(formatNoSpecialChar(convertedSearch)); } return originalResults; @@ -60,7 +60,6 @@ export default function SearchModal() { if (!isOpen) return null; const isSearching = isLoading || isFetching || isDebouncing; - const showSearchResults = searchInput && !isSearching && data; return (
@@ -102,7 +101,7 @@ export default function SearchModal() {

) : ( - showSearchResults && + )} diff --git a/FE/src/utils/format.ts b/FE/src/utils/format.ts index 84cf02d..bd1dfe6 100644 --- a/FE/src/utils/format.ts +++ b/FE/src/utils/format.ts @@ -1,5 +1,5 @@ export const formatNoSpecialChar = (query: string) => { - return query.replace(/[^a-zA-Z0-9가-힣 ]|\\/g, ''); + return query.replace(/[^a-zA-Z0-9가-힣ㄱ-ㅎㅏ-ㅣ ]|\\/g, ''); }; export function formatTime(time: string) {