fix: redirect to 404 on mii and profile not found

This commit is contained in:
trafficlunar 2025-04-05 14:45:33 +01:00
parent 49c6206623
commit ed33993a42
2 changed files with 7 additions and 1 deletions

View file

@ -1,6 +1,7 @@
import Image from "next/image";
import { prisma } from "@/lib/prisma";
import { redirect } from "next/navigation";
import { prisma } from "@/lib/prisma";
import MiiList from "@/app/components/mii-list";
interface Props {
@ -19,6 +20,8 @@ export default async function ProfilePage({ params, searchParams }: Props) {
const likedMiis = await prisma.like.count({ where: { userId: Number(slug) } });
if (!user) redirect("/404");
return (
<div>
<div className="flex gap-4 mb-2">