blob: 9b432bfb6199e4cf09c72a220e65faf45d6d9451 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import { data, redirect } from "react-router";
import type { LoaderFunctionArgs } from "react-router";
import { getBandBySlug } from "~/lib/db.server";
export async function loader({ params }: LoaderFunctionArgs) {
const band = getBandBySlug(params.slug!);
if (!band) throw data("Not found", { status: 404 });
return redirect(`/bands/of/${band.id}`);
}
export default function BandBySlug() {
return null;
}
|