sendou.ink/app/features/user-page/loaders/u.$identifier.vods.server.ts
Kalle f9192ff3d6
Some checks failed
E2E Tests / e2e (push) Has been cancelled
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled
Fix editing a Vod not showing the current PoV
2025-10-30 18:52:17 +02:00

16 lines
570 B
TypeScript

import type { LoaderFunctionArgs } from "@remix-run/node";
import * as UserRepository from "~/features/user-page/UserRepository.server";
import * as VodRepository from "~/features/vods/VodRepository.server";
import { notFoundIfFalsy } from "~/utils/remix.server";
export const loader = async ({ params }: LoaderFunctionArgs) => {
const userId = notFoundIfFalsy(
await UserRepository.identifierToUserId(params.identifier!),
).id;
return {
// TODO: add pagination instead of not showing oldest vods at all
vods: await VodRepository.findByUserId(userId),
};
};