diff --git a/src/components/common/SearchModal/hooks/useSearchModal.ts b/src/components/common/SearchModal/hooks/useSearchModal.ts index 6ab7f61d..d140251a 100644 --- a/src/components/common/SearchModal/hooks/useSearchModal.ts +++ b/src/components/common/SearchModal/hooks/useSearchModal.ts @@ -6,6 +6,7 @@ import { } from 'react-hook-form' import { mock_trendData } from '@/data' import { useRouter } from 'next/navigation' +import { notify } from '../../Toast/Toast' import { SearchFormValues } from '../SearchModal' export interface useSearchModalProps { @@ -43,7 +44,11 @@ const useSearchModal = ({ } const onSubmit: SubmitHandler = (data) => { - if (data.search.length === 1) return + if (data.search.length === 1) { + notify('info', '검색어는 최대 2글자여야 합니다.') + return + } + router.push(`/search?target=${data.target}&keyword=${data.search}`) }