lanjianrong hace 3 años
padre
commit
abca4da403
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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])