#I have a working server action but get a
1 messages · Page 1 of 1 (latest)
Hi @merry flame. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
async function mutate(formData: FormData) {
"use server"
await updateDb({
...post,
message: formData.get("message") as string,
})
revalidatePath("/next/writer/articles")
}
return (
<>
<p>{post.message}</p>
<form action={mutate}>
<input type="text" name="message" placeholder="Post message text" />
<button>Save</button>
</form>
</>
)
}```
Sorry @merry flame, I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
<form action={mutate as unknown as string}>
This resolves the type error but probably not best to do it like this.
I'm not sure if there's an issue on my end or something with nextjs as it seems like it's looking at the default "action" type