diff --git a/src/components/App/index/Projects.tsx b/src/components/App/index/Projects.tsx index 0581a27..fd7c26b 100644 --- a/src/components/App/index/Projects.tsx +++ b/src/components/App/index/Projects.tsx @@ -1,4 +1,4 @@ -import {unstable_noStore as noStore} from 'next/cache' +// import {unstable_noStore as noStore} from 'next/cache' import {client, urlForImage} from '@/lib/sanity' import Link from 'next/link' @@ -15,21 +15,24 @@ interface Project { in_development: boolean } -const getData = async (): Promise => { - noStore() - - const query = ` - *[_type == 'project'] { +async function getData(): Promise { + const data = await client.fetch( + `*[_type == 'project'] { name, link, id, description, image, in_development, - }` - - const data: Project[] = await client.fetch(query) - return data + }`, + {}, + { + next: { + revalidate: 30, + }, + }, + ) + return Array.isArray(data) ? data : [] } const Projects = async () => { @@ -43,18 +46,20 @@ const Projects = async () => {
my projects - {projects.map((slide, index) => ( -
-
- {slide.name} -
- -
- {slide.name} - {slide.description} -
-
- ))} +
+ {projects.map((slide, index) => ( +
+
+ {slide.name} +
+ +
+ {slide.name} + {slide.description} +
+
+ ))} +
) }