mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-01 07:37:55 -05:00
13 lines
416 B
TypeScript
13 lines
416 B
TypeScript
import invariant from "@sendou/utils/invariant";
|
|
import type { LoaderFunctionArgs } from "react-router";
|
|
import { notFoundIfNullish } from "~/utils/remix.server";
|
|
import { articleBySlug } from "../core/bySlug.server";
|
|
|
|
export const loader = ({ params }: LoaderFunctionArgs) => {
|
|
invariant(params.slug);
|
|
|
|
const article = notFoundIfNullish(articleBySlug(params.slug));
|
|
|
|
return { ...article, slug: params.slug };
|
|
};
|