15 lines
317 B
TypeScript
15 lines
317 B
TypeScript
import { redirect } from "@sveltejs/kit";
|
|
|
|
import type { PageLoad } from "./$types";
|
|
|
|
import { isLink, linkMap } from "../../../params/link";
|
|
|
|
export const load: PageLoad = async ({ params: { link } }) => {
|
|
|
|
link = link.toLowerCase();
|
|
|
|
if (!isLink(link))
|
|
redirect(302, '/')
|
|
|
|
redirect(302, linkMap[link])
|
|
};
|