Files
infra-map/src/routes/printer/filament/[id]/+page.server.ts

13 lines
348 B
TypeScript

import type { PageServerLoad } from './$types';
import { getFilamentByColor } from '$lib/server/database/filament';
export const load = async ({ params }: Parameters<PageServerLoad>[0]) => {
let { id } = params;
if (id) {
id = id.replaceAll('-', ' ');
}
const filament = await getFilamentByColor(id);
return { id, filament: filament };
};