diff --git a/front-end-dash.aggios.app/app/(agency)/configuracoes/page.tsx b/front-end-dash.aggios.app/app/(agency)/configuracoes/page.tsx index 9a5c8e4..bcc1826 100644 --- a/front-end-dash.aggios.app/app/(agency)/configuracoes/page.tsx +++ b/front-end-dash.aggios.app/app/(agency)/configuracoes/page.tsx @@ -77,7 +77,7 @@ export default function ConfiguracoesPage() { } // Buscar dados da API - const response = await fetch('http://localhost:8080/api/agency/profile', { + const response = await fetch('/api/agency/profile', { headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json', @@ -156,7 +156,7 @@ export default function ConfiguracoesPage() { return; } - const response = await fetch('http://localhost:8080/api/agency/profile', { + const response = await fetch('/api/agency/profile', { method: 'PUT', headers: { 'Authorization': `Bearer ${token}`, @@ -224,7 +224,7 @@ export default function ConfiguracoesPage() { return; } - const response = await fetch('http://localhost:8080/api/auth/change-password', { + const response = await fetch('/api/auth/change-password', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, diff --git a/front-end-dash.aggios.app/next.config.ts b/front-end-dash.aggios.app/next.config.ts index a628672..84b36f2 100644 --- a/front-end-dash.aggios.app/next.config.ts +++ b/front-end-dash.aggios.app/next.config.ts @@ -4,6 +4,16 @@ const nextConfig: NextConfig = { experimental: { externalDir: true, }, + async rewrites() { + return { + beforeFiles: [ + { + source: "/api/:path*", + destination: "http://backend:8080/api/:path*", + }, + ], + }; + }, }; export default nextConfig;