diff --git a/src/app/prosjekter/page.tsx b/src/app/prosjekter/page.tsx index c9bb5b93..791c4871 100644 --- a/src/app/prosjekter/page.tsx +++ b/src/app/prosjekter/page.tsx @@ -16,9 +16,6 @@ export const metadata: Metadata = { export default async function Prosjekter() { const posts: Project[] = await client.fetch(projectsQuery); - const featuredProjects = posts.filter((project) => project.featured); - const nonFeaturedProjects = posts.filter((project) => !project.featured); - return (
Prosjekter
- {featuredProjects.length > 0 && ( -
-
- {featuredProjects.map((project) => ( - - ))} -
-
- )}
- {nonFeaturedProjects.map((project) => ( + {posts.map((project) => ( ))}
diff --git a/src/lib/sanity/queries.ts b/src/lib/sanity/queries.ts index 4ef648a4..c3cf0969 100644 --- a/src/lib/sanity/queries.ts +++ b/src/lib/sanity/queries.ts @@ -1,7 +1,7 @@ import { groq } from "next-sanity"; export const projectsQuery = groq` - *[_type == "project"]{ + *[_type == "project"] | order(featureOrder asc) { id, name, description, @@ -18,7 +18,9 @@ export const projectsQuery = groq` ..., _key, }, - "projectimage": projectimage.asset->url + "projectimage": projectimage.asset->url, + featured, + featureOrder } `;