working on restore form.

This commit is contained in:
killian-larcher
2024-11-17 19:13:51 +01:00
parent ff9e3ffa67
commit 5d19970373
19 changed files with 1381 additions and 32 deletions
@@ -1,5 +1,5 @@
import {PageParams} from "@/types/next";
import {Page, PageContent, PageDescription, PageHeader, PageTitle} from "@/features/layout/page";
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
import {AgentForm} from "@/components/wrappers/Agent/AgentForm/AgentForm";
import {requiredCurrentUser} from "@/auth/current-user";
import {prisma} from "@/prisma";
@@ -9,14 +9,17 @@ import {notFound} from "next/navigation";
export default async function RoutePage(props: PageParams<{
agentId: string;
}>) {
const {agentId} = await props.params
const user = await requiredCurrentUser()
const agent = await prisma.agent.findUnique({
where: {
id: props.params.agentId,
id: agentId,
}
});
if (!agent){
if (!agent) {
notFound();
}