peer-at-code-web/src/routes/(app)/[link=link]/+page.ts
2024-04-16 00:43:58 +02:00

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])
};