fix search on selected navigation
This commit is contained in:
parent
7e152c1532
commit
656a6e08da
@ -7,6 +7,7 @@ import AsyncSelect from 'react-select/async';
|
||||
import './style.css';
|
||||
import { logoutService } from "../../services";
|
||||
import { getSearchLocationService } from "../../services/locations";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
|
||||
function Header() {
|
||||
@ -17,6 +18,7 @@ function Header() {
|
||||
})
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
const user = useSelector((state: UserRootState) => state.auth)
|
||||
|
||||
const onInput = (val: string): void => {
|
||||
@ -38,8 +40,8 @@ function Header() {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
const onSelectedSearchOption = (val) => {
|
||||
console.log(val)
|
||||
const onSelectedSearchOption = (val: any) => {
|
||||
navigate(`/location/${val.value}`)
|
||||
}
|
||||
|
||||
const onLoadSelectOptions = async (inputValue: string) => {
|
||||
|
@ -196,7 +196,7 @@ function LocationDetail() {
|
||||
if(updatePage) {
|
||||
getLocationDetail()
|
||||
}
|
||||
}, [updatePage])
|
||||
}, [updatePage, id])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
Loading…
Reference in New Issue
Block a user