run npm run format

This commit is contained in:
2026-03-17 20:05:44 +00:00
parent 64bc5b979d
commit b7007d2fb3
4 changed files with 74 additions and 81 deletions

View File

@@ -3,35 +3,35 @@ import type { PageLoad } from './$types';
import { error } from '@sveltejs/kit';
export const load: PageLoad = async ({ url }) => {
const locId = url.searchParams.get('loc');
const locId = url.searchParams.get('loc');
if (!LOCATIONS.loaded) {
await LOCATIONS.init(fetch);
}
if (!LOCATIONS.loaded) {
await LOCATIONS.init(fetch);
}
let title: string = "";
let title: string = '';
if (!locId) {
error(400, {
message: 'Location not provided',
owlCode: 'NO_LOCATION_IN_PATH',
});
}
if (!locId) {
error(400, {
message: 'Location not provided',
owlCode: 'NO_LOCATION_IN_PATH'
});
}
if (locId) {
const location = LOCATIONS.find(locId);
if (locId) {
const location = LOCATIONS.find(locId);
if (location) {
title = location.n || location.t;
} else {
error(404, {
message: `Location (${locId}) not found`,
owlCode: 'INVALID_LOCATION_CODE',
});
}
}
if (location) {
title = location.n || location.t;
} else {
error(404, {
message: `Location (${locId}) not found`,
owlCode: 'INVALID_LOCATION_CODE'
});
}
}
return {
title,
location,
location
};
};
};