diff --git a/src/components/survey-sale/list/ListTable.tsx b/src/components/survey-sale/list/ListTable.tsx index 0bfeafe..8ff5eaf 100644 --- a/src/components/survey-sale/list/ListTable.tsx +++ b/src/components/survey-sale/list/ListTable.tsx @@ -27,7 +27,7 @@ export default function ListTable() { }, [pathname]) useEffect(() => { - if (!session.isLoggedIn || !('data' in surveyList)) return + if (!session.isLoggedIn || isLoadingSurveyList) return if ('count' in surveyList && surveyList.count > 0) { if (offset > 0) { setHeldSurveyList((prev) => [...prev, ...surveyList.data]) @@ -45,14 +45,12 @@ export default function ListTable() { router.push(`/survey-sale/${id}`) } - // TODO: 로딩 처리 필요 - return ( <> -
- {heldSurveyList.length > 0 ? ( - - ) : ( -
- 作成された物件はありません。 -
- )} -
- setOffset(offset + 10)} /> + + ))} + + ) : ( +
+ 作成された物件はありません。
+ )} +
+ setOffset(offset + 10)} />
+
) } diff --git a/src/components/survey-sale/list/SearchForm.tsx b/src/components/survey-sale/list/SearchForm.tsx index e0de061..82147ba 100644 --- a/src/components/survey-sale/list/SearchForm.tsx +++ b/src/components/survey-sale/list/SearchForm.tsx @@ -6,7 +6,7 @@ import { useState } from 'react' export default function SearchForm({ memberRole, userNm }: { memberRole: string; userNm: string }) { const router = useRouter() - const { setSearchOption, setSort, setIsMySurvey, setKeyword, isMySurvey, keyword, searchOption, sort } = useSurveyFilterStore() + const { setSearchOption, setSort, setIsMySurvey, setKeyword, reset, isMySurvey, keyword, searchOption, sort } = useSurveyFilterStore() const [searchKeyword, setSearchKeyword] = useState(keyword) const [option, setOption] = useState(searchOption) @@ -15,6 +15,7 @@ export default function SearchForm({ memberRole, userNm }: { memberRole: string; alert('2文字以上入力してください') return } + reset() setKeyword(searchKeyword) setSearchOption(option) }