Add project posts to the website

This commit is contained in:
itsfinniii
2026-03-28 16:59:57 +01:00
parent e6977ec7dd
commit f4319c4165
5 changed files with 48 additions and 3 deletions

View File

@@ -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"],