diff options
Diffstat (limited to 'app/routes/list-by-slug.tsx')
| -rw-r--r-- | app/routes/list-by-slug.tsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/routes/list-by-slug.tsx b/app/routes/list-by-slug.tsx new file mode 100644 index 0000000..902c74e --- /dev/null +++ b/app/routes/list-by-slug.tsx @@ -0,0 +1,13 @@ +import { data, redirect } from "react-router"; +import type { LoaderFunctionArgs } from "react-router"; +import { getBandListBySlug } from "~/lib/db.server"; + +export async function loader({ params }: LoaderFunctionArgs) { + const list = getBandListBySlug(params.slug!); + if (!list) throw data("Not found", { status: 404 }); + return redirect(`/lists/of/${list.id}`); +} + +export default function ListBySlug() { + return null; +} |
