sendou.ink/app/features/settings/loaders/settings.server.ts
2026-05-23 18:07:01 +03:00

16 lines
461 B
TypeScript

import type { LoaderFunctionArgs } from "react-router";
import { getUser } from "~/features/auth/core/user.server";
import * as MatchProfileRepository from "~/features/match-profile/MatchProfileRepository.server";
export const loader = async (_args: LoaderFunctionArgs) => {
const user = getUser();
if (!user) {
return { matchProfile: null };
}
const matchProfile = await MatchProfileRepository.settingsByUserId(user.id);
return { matchProfile };
};