VideoChain-UI / src /server /actions.ts
jbilcke-hf's picture
jbilcke-hf HF Staff
added preview
c90a662
raw
history blame
614 Bytes
"use server"
import { revalidatePath } from "next/cache"
import { submitNewTask } from "."
export async function formSubmit(formData: FormData) {
const ownerId = `${formData.get("ownerId") || ""}`
console.log('submitting to ', ownerId)
await submitNewTask({
prompt: `${formData.get("prompt") || ""}`,
ownerId,
})
console.log('calling revalidate', ownerId)
// for doc see https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions
revalidatePath(`/studio/${ownerId}`)
}
export async function refreshStudio(ownerId: string) {
revalidatePath(`/studio/${ownerId}`)
}