Skip to content

fix api issue#2

Merged
MHammad33 merged 2 commits intomainfrom
fixes/api
Jun 24, 2025
Merged

fix api issue#2
MHammad33 merged 2 commits intomainfrom
fixes/api

Conversation

@MHammad33
Copy link
Owner

@MHammad33 MHammad33 commented Jun 24, 2025

This PR addresses an API configuration issue by updating the base URL for API calls to use an environment variable, allowing for more flexible endpoints during development and production. Key changes include:

@MHammad33 MHammad33 requested a review from Copilot June 24, 2025 11:14
@vercel
Copy link

vercel bot commented Jun 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
finance-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 24, 2025 11:18am

This comment was marked as outdated.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses an API configuration issue by updating the base URL for API calls to use an environment variable, allowing for more flexible endpoints during development and production. Key changes include:

  • Changing the base URL in transactionService.ts to use an environment variable with a fallback.
  • Changing the base URL in authService.ts similarly.
  • Updating environment example file and minor whitespace updates in App.tsx.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/services/transactionService.ts Updated baseUrl to use environment variable and fallback.
src/services/authService.ts Updated baseUrl to use environment variable and fallback.
src/App.tsx Added trailing newline.
.env.example Added environment variable definitions.


const baseUrl =
"https://personal-finance-tracker-production.up.railway.app/api/v1/transactions";
const baseUrl = `${import.meta.env.VITE_API_URL || "http://localhost:3000"}/api/v1/transactions`;
Copy link

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider extracting the API base URL configuration into a shared module to avoid duplication with other services.

Copilot uses AI. Check for mistakes.
import axios from "axios";
const baseUrl =
"https://personal-finance-tracker-production.up.railway.app/api/v1/auth";
const baseUrl = `${import.meta.env.VITE_API_URL || "http://localhost:3000"}/api/v1/auth`;
Copy link

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider extracting the API base URL configuration into a shared module to reduce duplication and ease maintenance across different services.

Copilot uses AI. Check for mistakes.
@MHammad33 MHammad33 merged commit b5babe4 into main Jun 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants