rename clients to devices

This commit is contained in:
2025-01-07 16:20:40 -08:00
parent d99ee9ef1e
commit cc7c94417d
25 changed files with 284 additions and 287 deletions

View File

@@ -0,0 +1,15 @@
import type { PageLoad } from './$types';
import { type DeviceDetails, deviceDetailsToConfig } from '$lib/devices';
import { error } from '@sveltejs/kit';
export const load: PageLoad = async ({ fetch, params }) => {
const res = await fetch(`/api/devices/${params.id}`);
const resJson = await res.json();
if (!res.ok) {
return error(res.status, resJson['message']);
}
const device = resJson as DeviceDetails;
const config = deviceDetailsToConfig(device);
return { device, config };
};