action.ts
'use server'
interface contactFormProps
{
name:string;
email:string;
Message:string;
}
export async function sendMail(props:contactFormProps) {
// ...
let res = await fetch(
`http://dummyjson.com/products/1`
);
await new Promise((resolve) => setTimeout(resolve, 20));
//console.log(res.json)
//return res.json();
return JSON.stringify( " success ") ;
}
client
const onSubmit = async (data:T) => {
let { response } = await action(data);
console.log(" output :"+response)
};
I just want it respond. All i get is output : undefined