From b329abcf0ea5b3e8e70efdb8513af20f403fbf97 Mon Sep 17 00:00:00 2001
From: parsa aghaei
Date: Sat, 8 Aug 2026 19:12:55 +0330
Subject: [PATCH] fix(contact): route contact form submission directly to
backend API (http://127.0.0.1:4001/api/contact)
---
frontend/application/components/ContactFormClient.tsx | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/frontend/application/components/ContactFormClient.tsx b/frontend/application/components/ContactFormClient.tsx
index f7126582..b5422403 100644
--- a/frontend/application/components/ContactFormClient.tsx
+++ b/frontend/application/components/ContactFormClient.tsx
@@ -2,7 +2,7 @@
import { useEffect, useState } from "react";
import { Mail, Phone, MapPin, Send, CheckCircle2 } from "lucide-react";
-import axios from "axios";
+import api from "../lib/services/api";
interface ContactInfoItem {
key: string;
@@ -21,19 +21,17 @@ export default function ContactFormClient() {
const [success, setSuccess] = useState(false);
const [error, setError] = useState("");
- const API_URL = process.env.NEXT_PUBLIC_API_URL || "";
-
useEffect(() => {
async function fetchContactInfo() {
try {
- const res = await axios.get(`${API_URL}/contact/info`);
+ const res = await api.get("/contact/info");
setInfoItems(res.data || []);
} catch (err) {
console.error("Failed to fetch contact info", err);
}
}
fetchContactInfo();
- }, [API_URL]);
+ }, []);
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
@@ -45,7 +43,7 @@ export default function ContactFormClient() {
setLoading(true);
try {
- await axios.post(`${API_URL}/contact`, {
+ await api.post("/contact", {
name,
phone,
subject,