Skip to content

Commit

Permalink
fix: unable to edit after sample email
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersuweijie committed Oct 24, 2024
1 parent 1026bd2 commit ca2d63a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/app/src/app/edit/[[...slug]]/content.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
'use client'
import { formSchema } from "@/app/submit/form";
import { z } from "zod";
import { submit } from "./action";
import { Entry } from "@prisma/client";
import { EntryForm } from "@/components/entry-form";

export default function Content({entry}: {entry: Entry, sampleEmail: string}) {
async function onSubmit(values: z.infer<typeof formSchema>) {
await submit(values)
}
return (
<div className="w-full py-20 lg:py-40">
<div className="container mx-auto">
Expand All @@ -13,7 +17,7 @@ export default function Content({entry}: {entry: Entry, sampleEmail: string}) {
<h1 className="text-xl md:text-3xl tracking-tighter text-left font-extrabold">Edit pattern</h1>
<h1 className="text-md md:text-xl tracking-tighter text-left">{entry.title}</h1>
<h1 className="text-md md:text-xl tracking-tighter text-left">{entry.description}</h1>
<EntryForm entry={entry} onFormSubmit={submit} />
<EntryForm entry={entry} onFormSubmit={onSubmit} />
</div>
</div>
</div>
Expand Down

0 comments on commit ca2d63a

Please sign in to comment.