mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-22 01:42:47 +00:00
17 lines
448 B
TypeScript
17 lines
448 B
TypeScript
import type { PageLoad } from "./$types";
|
|
import type { DirectoryListing } from "../listing";
|
|
|
|
export const load = (async ({ fetch, params }) => {
|
|
const result = await fetch(
|
|
`${import.meta.env.VITE_FIRMWARE_URL}/${params.device}/`,
|
|
);
|
|
const data = await result.json();
|
|
|
|
return {
|
|
versions: (data as DirectoryListing[]).sort((a, b) =>
|
|
b.name.localeCompare(a.name),
|
|
),
|
|
device: params.device,
|
|
};
|
|
}) satisfies PageLoad;
|