From 81640be86aba484d94f1447cc618126fa5e91110 Mon Sep 17 00:00:00 2001 From: Alaguraj0361 Date: Tue, 4 Nov 2025 21:41:22 +0530 Subject: [PATCH] api call baseUrl updated local to server call --- components/auth/components-auth-login-form.tsx | 2 +- components/auth/components-auth-register-form.tsx | 2 +- components/user/user-module.tsx | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/auth/components-auth-login-form.tsx b/components/auth/components-auth-login-form.tsx index 73229e3..ce0fe72 100644 --- a/components/auth/components-auth-login-form.tsx +++ b/components/auth/components-auth-login-form.tsx @@ -29,7 +29,7 @@ const ComponentsAuthLoginForm = () => { setLoading(true); try { // ✅ Call your Next.js API (same origin), which sets d4a_uid, d4a_session, d4a_exp cookies - const res = await fetch('http://localhost:3003/api/auth/login', { + const res = await fetch('https://ebay.backend.data4autos.com/api/auth/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, // credentials not required for same-origin, but harmless: diff --git a/components/auth/components-auth-register-form.tsx b/components/auth/components-auth-register-form.tsx index 8f59fd8..bba0fc2 100644 --- a/components/auth/components-auth-register-form.tsx +++ b/components/auth/components-auth-register-form.tsx @@ -8,7 +8,7 @@ import IconUser from '@/components/icon/icon-user'; const API_BASE = process.env.NEXT_PUBLIC_API_BASE_URL?.replace(/\/$/, '') || // 'https://ebay.backend.data4autos.com'; - 'http://localhost:3003'; + 'https://ebay.backend.data4autos.com'; const ComponentsAuthRegisterForm = () => { diff --git a/components/user/user-module.tsx b/components/user/user-module.tsx index ad64488..62ef07d 100644 --- a/components/user/user-module.tsx +++ b/components/user/user-module.tsx @@ -26,7 +26,7 @@ const UserModule = () => { // ✅ Fetch users const fetchUsers = async () => { try { - const res = await axios.get('http://localhost:3003/api/auth/users'); + const res = await axios.get('https://ebay.backend.data4autos.com/api/auth/users'); setUsers(res.data?.users || []); setFilteredUsers(res.data?.users || []); } catch (err) { @@ -80,11 +80,11 @@ const UserModule = () => { try { if (params.userid) { // UPDATE - await axios.put(`http://localhost:3003/api/auth/users/${params.userid}`, params); + await axios.put(`https://ebay.backend.data4autos.com/api/auth/users/${params.userid}`, params); showMessage('User updated successfully'); } else { // ADD - await axios.post('http://localhost:3003/api/auth/users/add', params); + await axios.post('https://ebay.backend.data4autos.com/api/auth/users/add', params); showMessage('User added successfully'); } setAddUserModal(false); @@ -113,7 +113,7 @@ const UserModule = () => { }).then(async (result) => { if (result.isConfirmed) { try { - await axios.delete(`http://localhost:3003/api/auth/users/${user.userid}`); + await axios.delete(`https://ebay.backend.data4autos.com/api/auth/users/${user.userid}`); showMessage('User deleted successfully'); fetchUsers(); } catch (err) {