fix search on selected navigation

This commit is contained in:
NCanggoro 2024-03-04 16:19:04 +07:00
parent 7e152c1532
commit 656a6e08da
2 changed files with 5 additions and 3 deletions

View File

@ -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) => {

View File

@ -196,7 +196,7 @@ function LocationDetail() {
if(updatePage) {
getLocationDetail()
}
}, [updatePage])
}, [updatePage, id])
return (
<>