fix: Remove duplicate /api/v1 from API URLs
Some checks failed
CI/CD Pipeline / Build Application (push) Has been cancelled
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
Some checks failed
CI/CD Pipeline / Build Application (push) Has been cancelled
ParentFlow CI/CD Pipeline / Backend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Frontend Tests (push) Has been cancelled
ParentFlow CI/CD Pipeline / Security Scanning (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-app/maternal-app-backend dockerfile:Dockerfile.production name:backend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Build Docker Images (map[context:maternal-web dockerfile:Dockerfile.production name:frontend]) (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Development (push) Has been cancelled
ParentFlow CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { tokenStorage } from '@/lib/utils/tokenStorage';
|
||||
|
||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000';
|
||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3020';
|
||||
|
||||
export const apiClient = axios.create({
|
||||
baseURL: API_BASE_URL,
|
||||
|
||||
@@ -35,7 +35,7 @@ class ApiClient {
|
||||
private async request(method: string, endpoint: string, data?: any, options?: any) {
|
||||
const config = {
|
||||
method,
|
||||
url: `${API_BASE_URL}${endpoint}`,
|
||||
url: `${API_BASE_URL}/api/v1${endpoint}`,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
...(this.token ? { Authorization: `Bearer ${this.token}` } : {}),
|
||||
@@ -55,7 +55,7 @@ class ApiClient {
|
||||
// Handle token refresh
|
||||
if (error.response?.status === 401 && this.refreshToken) {
|
||||
try {
|
||||
const refreshResponse = await axios.post(`${API_BASE_URL}/auth/refresh`, {
|
||||
const refreshResponse = await axios.post(`${API_BASE_URL}/api/v1/auth/refresh`, {
|
||||
refreshToken: this.refreshToken,
|
||||
});
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ fi
|
||||
# Create .env.local if it doesn't exist
|
||||
if [ ! -f ".env.local" ]; then
|
||||
cat > .env.local << EOF
|
||||
NEXT_PUBLIC_API_URL=https://maternal-api.noru1.ro/api/v1
|
||||
NEXT_PUBLIC_API_URL=https://maternal-api.noru1.ro
|
||||
NEXT_PUBLIC_GRAPHQL_URL=https://maternal-api.noru1.ro/graphql
|
||||
NEXT_PUBLIC_WS_URL=wss://maternal-api.noru1.ro
|
||||
NEXT_PUBLIC_APP_URL=https://maternal.noru1.ro
|
||||
@@ -172,7 +172,7 @@ fi
|
||||
# Create .env.local if it doesn't exist
|
||||
if [ ! -f ".env.local" ]; then
|
||||
cat > .env.local << EOF
|
||||
NEXT_PUBLIC_API_URL=https://maternal-api.noru1.ro/api/v1
|
||||
NEXT_PUBLIC_API_URL=https://maternal-api.noru1.ro
|
||||
NEXT_PUBLIC_APP_URL=https://pfadmin.noru1.ro
|
||||
NEXT_PUBLIC_APP_NAME=ParentFlow Admin
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user