|
|
|
@ -30,13 +30,17 @@ export const AddressSearch = ({ autoFocus = false }) => {
|
|
|
|
const { setClickedPointConfig } = useClickedPointConfig();
|
|
|
|
const { setClickedPointConfig } = useClickedPointConfig();
|
|
|
|
const inputRef = useRef();
|
|
|
|
const inputRef = useRef();
|
|
|
|
|
|
|
|
|
|
|
|
const { data } = useQuery(["address", debouncedValue], async () => {
|
|
|
|
const { data } = useQuery(
|
|
|
|
|
|
|
|
["address", debouncedValue],
|
|
|
|
|
|
|
|
async () => {
|
|
|
|
const result = await api.get(
|
|
|
|
const result = await api.get(
|
|
|
|
`/api/placement_points/search_address?page_size=100&address=${debouncedValue}`
|
|
|
|
`/api/placement_points/search_address?page_size=100&address=${debouncedValue}`
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
return result.data;
|
|
|
|
return result.data;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
{ enabled: !!debouncedValue }
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const options = useMemo(() => {
|
|
|
|
const options = useMemo(() => {
|
|
|
|
if (!data) return [];
|
|
|
|
if (!data) return [];
|
|
|
|
|