Remove aboutme-related API endpoints

This commit is contained in:
Matthew Barnes 2023-06-24 01:13:24 +01:00
parent aa98a3fc4a
commit 6298786140
Signed by: mb2g17
GPG Key ID: 2D2CFBEE0B64E30B
2 changed files with 0 additions and 22 deletions

View File

@ -1,21 +0,0 @@
import { json } from '@sveltejs/kit';
import type { Employment } from '$lib/types';
import { getSlugFromPath, markdownToEmployment } from '$lib/utils';
export const prerender = true;
export const GET = async ({ url }) => {
const modules = import.meta.glob("/static/content/employments/*.md", { as: "raw" });
let employments: Employment[] = [];
for (const path in modules) {
const contents = await modules[path]() as string;
const employment = markdownToEmployment(contents, getSlugFromPath(path));
employments = [employment, ...employments];
}
// Sort by start date
employments.sort((e1, e2) => e2._startDate - e1._startDate);
return json(employments);
}

View File

@ -24,7 +24,6 @@ const config = {
entries: [
'/aboutme',
'/donate',
'/_api/employments.json',
],
}
}