Files
parakasa/lib/actions/contact.ts

20 lines
561 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use server"
import { contactFormSchema, ContactFormValues } from "@/lib/schemas"
export async function submitContactForm(data: ContactFormValues) {
const result = contactFormSchema.safeParse(data)
if (!result.success) {
return { success: false, error: "Geçersiz form verileri." }
}
// Simulate email sending or DB insertion
await new Promise((resolve) => setTimeout(resolve, 1000))
// In a real app, you would use Resend or Nodemailer here
return { success: true, message: "Mesajınız başarıyla gönderildi." }
}