Add project posts to the website
This commit is contained in:
@@ -28,6 +28,7 @@ export async function getAllProjects(settings: GlobalSettings): Promise<ProjectP
|
||||
exists: true,
|
||||
type: "ProjectPost",
|
||||
lastModified: new Date(),
|
||||
id: projectRecord["id"],
|
||||
title: projectRecord["title"],
|
||||
content: projectRecord["content"],
|
||||
date: projectRecord["date"],
|
||||
@@ -98,6 +99,7 @@ export async function getProject(settings: GlobalSettings, route: string): Promi
|
||||
exists: true,
|
||||
|
||||
lastModified: new Date(),
|
||||
id: projectRecord["id"],
|
||||
title: projectRecord["title"],
|
||||
content: projectRecord["content"],
|
||||
date: projectRecord["date"],
|
||||
@@ -143,7 +145,7 @@ export async function getProject(settings: GlobalSettings, route: string): Promi
|
||||
}
|
||||
|
||||
export async function getLastProjects(amount: number): Promise<ProjectPost[]> {
|
||||
const client = await createDirectusConnection();
|
||||
const client = await createDirectusConnection();
|
||||
const result = await client.query(print(getLastProjectsQuery), {
|
||||
date: formatDate(new Date(), "%Y-%M-%D"),
|
||||
amount: amount
|
||||
@@ -164,6 +166,7 @@ const client = await createDirectusConnection();
|
||||
exists: true,
|
||||
type: "ProjectPost",
|
||||
lastModified: new Date(),
|
||||
id: projectRecord["id"],
|
||||
title: projectRecord["title"],
|
||||
content: projectRecord["content"],
|
||||
date: projectRecord["date"],
|
||||
@@ -236,6 +239,7 @@ export async function getAllPaginatedProjects(settings: GlobalSettings, page: nu
|
||||
exists: true,
|
||||
type: "ProjectPost",
|
||||
lastModified: new Date(),
|
||||
id: projectRecord["id"],
|
||||
title: projectRecord["title"],
|
||||
content: projectRecord["content"],
|
||||
date: projectRecord["date"],
|
||||
|
||||
Reference in New Issue
Block a user