diff --git a/src/components/SearchInput.jsx b/src/components/SearchInput.jsx index b76a497..a30bcfa 100644 --- a/src/components/SearchInput.jsx +++ b/src/components/SearchInput.jsx @@ -2,7 +2,7 @@ import React, { useMemo, useRef, useState, useEffect } from 'react'; import { Select, Spin } from 'antd'; import { debounce, objectMapper } from '@/utils/commons'; -function DebounceSelect({ fetchOptions, debounceTimeout = 500, initLoad = false, defaultOptions=[], ...props }) { +function DebounceSelect({ fetchOptions, debounceTimeout = 500, initLoad = false, defaultOptions=[], onFetch=null, ...props }) { const [fetching, setFetching] = useState(false); const [options, setOptions] = useState([]); const fetchRef = useRef(0); @@ -28,7 +28,7 @@ function DebounceSelect({ fetchOptions, debounceTimeout = 500, initLoad = false, } setOptions(mapperOptions); setFetching(false); - props.onFetch && props.onFetch(mapperOptions); + onFetch && onFetch(mapperOptions); }); }; diff --git a/src/stores/Form.js b/src/stores/Form.js index 78af78a..9657b84 100644 --- a/src/stores/Form.js +++ b/src/stores/Form.js @@ -1,11 +1,12 @@ import { create } from 'zustand'; import { devtools } from 'zustand/middleware'; +import { usingStorage } from '@/hooks/usingStorage' export const useFormStore = create( devtools((set, get) => ({ formValues: {}, setFormValues: (values) => set((state) => ({ formValues: { ...state.formValues, ...values } })), - formValuesToSub: {}, + formValuesToSub: { agency: usingStorage().travelAgencyId }, setFormValuesToSub: (values) => set((state) => ({ formValuesToSub: { ...state.formValuesToSub, ...values } })), cache: {},