瀏覽代碼

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])