lanjianrong 3 gadi atpakaļ
vecāks
revīzija
abca4da403

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