Error boundary

This commit is contained in:
PxlLoewe
2025-03-26 14:04:15 -07:00
parent 9551202370
commit c8d91b684f
21 changed files with 414 additions and 298 deletions

View File

@@ -1,13 +1,13 @@
import { prisma } from '@repo/db';
import { StationForm } from '../_components/Form';
import { prisma } from "@repo/db";
import { KeywordForm } from "../_components/Form";
export default async ({ params }: { params: Promise<{ id: string }> }) => {
const { id } = await params;
const station = await prisma.station.findUnique({
where: {
id: parseInt(id),
},
});
if (!station) return <div>Station not found</div>;
return <StationForm station={station} />;
const { id } = await params;
const keyword = await prisma.keyword.findUnique({
where: {
id: parseInt(id),
},
});
if (!keyword) return <div>Station not found</div>;
return <KeywordForm keyword={keyword} />;
};