Migrated codebase to TypeScript
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import type { PageServerLoad } from './$types.js';
|
||||
import { fetchStations } from '$lib/api.js';
|
||||
|
||||
export const load: PageServerLoad = async ({ fetch }) => {
|
||||
try {
|
||||
return { stations: await fetchStations(fetch) };
|
||||
} catch {
|
||||
return { stations: [], loadError: 'Impossibile caricare le centraline. Controlla la connessione e riprova.' };
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user