|
|
|
|
@ -2,7 +2,7 @@ import { Box } from '@mantine/core';
|
|
|
|
|
import {
|
|
|
|
|
createBrowserRouter,
|
|
|
|
|
RouterProvider,
|
|
|
|
|
useLoaderData,
|
|
|
|
|
// useLoaderData,
|
|
|
|
|
} from 'react-router-dom';
|
|
|
|
|
|
|
|
|
|
import { KartaPage } from './KartaPage';
|
|
|
|
|
@ -14,12 +14,6 @@ import headerLinks from './assets/header.json';
|
|
|
|
|
import footerLinks from './assets/footer.json';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const articleLoader = async function({ params }) {
|
|
|
|
|
const response = await fetch("http://strapi.wg.gateway.ts/api/articles?filters[id][$eq]=3")
|
|
|
|
|
const article = await response.json()
|
|
|
|
|
return article;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
|
{
|
|
|
|
|
path: "/",
|
|
|
|
|
@ -33,7 +27,7 @@ const router = createBrowserRouter([
|
|
|
|
|
path: "/article/:id",
|
|
|
|
|
element: <Article />,
|
|
|
|
|
loader: async ({ params }) => {
|
|
|
|
|
return fetch(`http://strapi.wg.gateway.ts/api/articles?populate=*&filters[id][$eq]=${params.id}`);
|
|
|
|
|
return fetch(`https://strapi.iamonlyherefortheicecream.gq/api/articles?populate=*&filters[id][$eq]=${params.id}`);
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
|