Site için geliştirmeler yapıldı.
This commit is contained in:
19
lib/actions/contact.ts
Normal file
19
lib/actions/contact.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
"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
|
||||
console.log("Contact Form Submitted:", result.data)
|
||||
|
||||
return { success: true, message: "Mesajınız başarıyla gönderildi." }
|
||||
}
|
||||
Reference in New Issue
Block a user