diff --git a/next.config.ts b/next.config.ts index 02ff965..8d3a29b 100644 --- a/next.config.ts +++ b/next.config.ts @@ -5,11 +5,12 @@ const nextConfig: NextConfig = { async rewrites() { return [ { - source: '/api/v1/:path*', // somente rotas API + source: '/api/v1/:path*', destination: 'http://api_saas_api_homologacao:8000/api/v1/:path*', }, ]; }, + }; export default nextConfig; diff --git a/src/services/api/Api.ts b/src/services/api/Api.ts index 4c00e4b..868f579 100644 --- a/src/services/api/Api.ts +++ b/src/services/api/Api.ts @@ -37,18 +37,15 @@ export default class API { // Verifica se existe body para envio const filteredBody = _data.body ? Object.fromEntries( - Object.entries(_data.body).filter( - ([_, v]) => v != null && v !== "", - ), - ) + Object.entries(_data.body).filter( + ([_, v]) => v != null && v !== "", + ), + ) : null; - console.log(`/${this.ApiSchema.prefix}${this.ApiSchema.endpoint}`); - - // Realiza a requisição const response = await fetch( - `/${this.ApiSchema.prefix}${this.ApiSchema.endpoint}`, + `${this.ApiSchema.url}${this.ApiSchema.prefix}${this.ApiSchema.endpoint}`, { method: _data.method, headers: {