vibecraft / src /server /actions.ts
bmorphism's picture
Duplicate from bmorphism/vibecraft
a85305f
raw
history blame
498 Bytes
"use server"
import { revalidatePath } from "next/cache"
import { createNewVideo } from "."
export async function isAdmin(adminSecret: string) {
return adminSecret === process.env.ADMIN_SECRET
}
export async function handleFormSubmit(formData: FormData) {
const ownerId = `${formData.get("ownerId") || ""}`
await createNewVideo(ownerId, {
prompt: `${formData.get("prompt") || ""}`,
})
}
export async function refreshStudio(ownerId: string) {
revalidatePath(`/studio/${ownerId}`)
}