Spaces:
Paused
Paused
File size: 397 Bytes
43dd1ac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
"use server"
import { revalidatePath } from "next/cache"
import { submitNewTask } from "."
export async function formSubmit(formData: FormData) {
await submitNewTask({
prompt: `${formData.get("prompt") || ""}`,
ownerId: `${formData.get("ownerId") || ""}`,
})
// for doc see https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions
revalidatePath('/')
} |