pre-render all u pages

This commit is contained in:
Kalle (Sendou) 2020-12-02 10:11:53 +02:00
parent 25bc21d893
commit 9a99d67baf

View File

@ -140,12 +140,11 @@ const ProfilePage = (props: Props) => {
export const getStaticPaths: GetStaticPaths = async () => {
const users = await prisma.user.findMany({
where: { NOT: [{ profile: { customUrlPath: null } }] },
include: { profile: true },
});
return {
paths: users.map((u) => ({
params: { identifier: u.profile!.customUrlPath! },
params: { identifier: u.profile?.customUrlPath ?? u.discordId },
})),
fallback: true,
};