mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
13 lines
406 B
TypeScript
13 lines
406 B
TypeScript
import type { LoaderFunctionArgs } from "react-router";
|
|
import invariant from "~/utils/invariant";
|
|
import { notFoundIfFalsy } from "~/utils/remix.server";
|
|
import { articleBySlug } from "../core/bySlug.server";
|
|
|
|
export const loader = ({ params }: LoaderFunctionArgs) => {
|
|
invariant(params.slug);
|
|
|
|
const article = notFoundIfFalsy(articleBySlug(params.slug));
|
|
|
|
return { ...article, slug: params.slug };
|
|
};
|