소스 검색

feat: 1111

lanjianrong 3 년 전
부모
커밋
abca4da403
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      src/pages/Institutions/Staff/components/DebounceSelect.tsx

+ 3 - 1
src/pages/Institutions/Staff/components/DebounceSelect.tsx

@@ -49,7 +49,9 @@ function DebounceSelect<
   }, [fetchOptions, debounceTimeout])
   useEffect(() => {
     if (!state.options?.length && state.val) {
-      debounceFetcher({ ID: state.val })
+      fetchOptions({ ID: state.val }).then(newOptions => {
+        setState({ ...state, options: newOptions, fetching: false })
+      })
     }
   }, [state.val])