diff --git a/src/app/page.tsx b/src/app/page.tsx index 8f9d776..bad4a67 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,11 +1,14 @@ +import Link from 'next/link' + import Stocks from '@/components/Stocks' -import Program from '@/components/Programs' export default function Home() { return ( <> + + К программам + - ) } diff --git a/src/app/program/[slug]/page.tsx b/src/app/program/[slug]/page.tsx index ba351f8..ecb27a0 100644 --- a/src/app/program/[slug]/page.tsx +++ b/src/app/program/[slug]/page.tsx @@ -1,9 +1,13 @@ +import {unstable_noStore as noStore} from 'next/cache' + import Link from 'next/link' import Image from 'next/image' import {client, urlForImage, urlForFile} from '@/lib/sanity' const getData = async (slug) => { + noStore() + const query = ` *[_type == 'program' && slug.current == '${slug}'][0] { name, @@ -24,8 +28,8 @@ const ProgramPage = async ({params}) => { return (
- - На главную + + К программам
diff --git a/src/app/program/page.tsx b/src/app/program/page.tsx new file mode 100644 index 0000000..c79251a --- /dev/null +++ b/src/app/program/page.tsx @@ -0,0 +1,14 @@ +import Link from 'next/link' + +import Programs from '@/components/Programs' + +export default function Program() { + return ( + <> + + На главную + + + + ) +} diff --git a/src/components/Programs.tsx b/src/components/Programs.tsx index e3ffa06..b01e9fc 100644 --- a/src/components/Programs.tsx +++ b/src/components/Programs.tsx @@ -1,3 +1,5 @@ +import {unstable_noStore as noStore} from 'next/cache' + import Link from 'next/link' import Image from 'next/image' import {client, urlForImage} from '@/lib/sanity' @@ -11,9 +13,9 @@ interface Program { slug: {current: string} } -export const revalidate = 30 - const getData = async (): Promise => { + noStore() + const query = ` *[_type == 'program'] { name, diff --git a/src/components/Stocks.tsx b/src/components/Stocks.tsx index 8199058..489ec80 100644 --- a/src/components/Stocks.tsx +++ b/src/components/Stocks.tsx @@ -1,8 +1,12 @@ +import {unstable_noStore as noStore} from 'next/cache' + import Image from 'next/image' import {client, urlForImage} from '@/lib/sanity' const getData = async () => { + noStore() + const query = ` *[_type == 'stocks'] { images