project type and added query file
This commit is contained in:
29
utilities/queries.ts
Normal file
29
utilities/queries.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import payloadConfig from "@/src/payload.config"
|
||||
import { getPayload } from "payload"
|
||||
|
||||
const payload = await getPayload({ config: payloadConfig })
|
||||
|
||||
export const HOMEPAGE_QUERY = await payload.find({
|
||||
collection: 'pages',
|
||||
where: {
|
||||
title: {
|
||||
equals: 'Home'
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export const PROJECT_QUERY = await payload.find({
|
||||
collection: 'projects',
|
||||
select: {
|
||||
title: true,
|
||||
slug: true,
|
||||
featuredImage: true,
|
||||
description: true,
|
||||
link: true,
|
||||
github: true,
|
||||
order: true,
|
||||
categories: true,
|
||||
featuredProject: true,
|
||||
},
|
||||
sort: '-order'
|
||||
})
|
||||
Reference in New Issue
Block a user