feat: return endpoint config from server

This commit is contained in:
Wentao Lyu 2023-04-01 14:33:07 +08:00
parent b687ab30ed
commit 60be4f12b7
4 changed files with 25 additions and 13 deletions

View file

@ -38,7 +38,7 @@ const router = createBrowserRouter([
const App = () => {
const [user, setUser] = useRecoilState(store.user);
const setIsSearchEnabled = useSetRecoilState(store.isSearchEnabled);
const setEndpointsFilter = useSetRecoilState(store.endpointsFilter);
const setEndpointsConfig = useSetRecoilState(store.endpointsConfig);
useEffect(() => {
// fetch if seatch enabled
@ -63,7 +63,7 @@ const App = () => {
withCredentials: true
})
.then(({ data }) => {
setEndpointsFilter(data);
setEndpointsConfig(data);
})
.catch(error => {
console.error(error);