2024-06-13 10:11:09 +00:00
|
|
|
"use server"
|
2024-06-13 19:52:44 +00:00
|
|
|
import { getPubs, getResponses, getStories } from "app/lib/get";
|
2024-06-12 09:00:59 +00:00
|
|
|
import SubmissionForm from "app/ui/forms/sub";
|
2024-06-14 09:25:18 +00:00
|
|
|
import { SelectForm } from "app/ui/forms/selectDemo";
|
2024-06-17 21:23:09 +00:00
|
|
|
import prisma from "app/lib/db";
|
2024-06-13 19:52:44 +00:00
|
|
|
|
2024-06-13 10:11:09 +00:00
|
|
|
export default async function Page() {
|
2024-06-13 19:52:44 +00:00
|
|
|
const stories = await getStories()
|
|
|
|
const pubs = await getPubs()
|
|
|
|
const responses = await getResponses()
|
2024-06-17 21:23:09 +00:00
|
|
|
async function createSub(data) {
|
|
|
|
"use server"
|
|
|
|
const res = await prisma.sub.create({ data })
|
|
|
|
console.log(res)
|
|
|
|
}
|
|
|
|
return <SubmissionForm stories={stories} pubs={pubs} responses={responses} createSub={createSub} />
|
2024-06-12 09:00:59 +00:00
|
|
|
}
|