settings work
This commit is contained in:
@ -14,6 +14,7 @@ import { useAppDispatch, useAppSelector } from './hooks';
|
||||
import { store } from '../redux/main';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import SettingsPage from './Settings';
|
||||
import { apiFetch } from './api';
|
||||
|
||||
function MainPage() {
|
||||
const dispatch = useAppDispatch();
|
||||
@ -30,7 +31,7 @@ function MainPage() {
|
||||
useEffect(() => {
|
||||
const fetchMetadata = async () => {
|
||||
try {
|
||||
const response = await fetch('http://localhost:5010/meta');
|
||||
const response = await apiFetch('meta');
|
||||
const data = await response.json();
|
||||
dispatch({ type: 'metadata/setAllData', payload: data });
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user