summaryrefslogtreecommitdiff
path: root/app/routes/artist-by-slug.tsx
blob: 5b38df2a28e740241a4714705aeea01e2bf4e988 (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 { getArtistBySlug } from "~/lib/db.server";

export async function loader({ params }: LoaderFunctionArgs) {
  const artist = getArtistBySlug(params.slug!);
  if (!artist) throw data("Not found", { status: 404 });
  return redirect(`/artists/of/${artist.id}`);
}

export default function ArtistBySlug() {
  return null;
}