mirror of
https://github.com/KevinMidboe/infra-map.git
synced 2025-10-29 09:30:29 +00:00
source, static files & Dockerfile
This commit is contained in:
11
src/routes/printer/+page.server.ts
Normal file
11
src/routes/printer/+page.server.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { PageServerLoad } from './$types';
|
||||
import { fetchP1P } from '$lib/server/homeassistant';
|
||||
import { currentFilament } from '$lib/server/filament';
|
||||
import type { Entity } from '$lib/interfaces/homeassistant';
|
||||
import type { Filament } from '$lib/interfaces/printer';
|
||||
|
||||
export const load: PageServerLoad = async (): Promise<{ p1p: Entity[]; filament: Filament[] }> => {
|
||||
const p1p = await fetchP1P();
|
||||
const filament = currentFilament();
|
||||
return { p1p, filament };
|
||||
};
|
||||
Reference in New Issue
Block a user