fix: firmware cannot be linked

This commit is contained in:
2024-11-08 15:21:53 +01:00
parent 3a02caeb6d
commit 3659b80e41
10 changed files with 2 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
import type { PageLoad } from "./$types";
import type { FileListing, Listing } from "../../listing";
export const load = (async ({ fetch, params }) => {
const result = await fetch(
`${import.meta.env.VITE_FIRMWARE_URL}/${params.device}/${params.version}/`,
);
const data: Listing[] = await result.json();
return {
uf2: data.find(
(entry) => entry.type === "file" && entry.name === "CURRENT.UF2",
) as FileListing,
ota: data.find(
(entry) => entry.type === "file" && entry.name === "firmware.bin",
),
version: params.version,
device: params.device,
};
}) satisfies PageLoad;