Skip to content

fix: use environment-based API URL for FeedbackModal requests - #682

Open
broskell wants to merge 1 commit into
lovelymahor:mainfrom
broskell:fix/feedbackmodal-hardcoded-url
Open

fix: use environment-based API URL for FeedbackModal requests#682
broskell wants to merge 1 commit into
lovelymahor:mainfrom
broskell:fix/feedbackmodal-hardcoded-url

Conversation

@broskell

Copy link
Copy Markdown

Summary

This PR replaces the hardcoded backend URL in FeedbackModal with the existing REACT_APP_API_URL environment configuration used throughout the project.

Problem

The feedback modal was making requests to a hardcoded endpoint:

http://localhost:5000/api/feedback

This works only during local development and causes feedback submissions to fail in deployed environments.

Solution

  • Replaced the hardcoded API URL with an environment-based URL derived from REACT_APP_API_URL.
  • Kept the existing localhost fallback for local development.
  • Matched the same API URL pattern already used in other parts of the codebase to maintain consistency.

Benefits

  • ✅ Feedback submissions now work in production deployments.
  • ✅ Consistent API configuration across the application.
  • ✅ No breaking changes.
  • ✅ No additional dependencies.
  • ✅ Minimal and focused change.

Files Changed

  • client/src/components/FeedbackModal.js

Testing

  • Verified the project builds successfully.
  • Confirmed the feedback endpoint now resolves using the configured environment variable.
  • Ensured local development continues to work through the existing fallback URL.

Checklist

  • Follows existing project conventions
  • No breaking changes
  • No new dependencies
  • Production-friendly
  • Small, reviewable diff

…lhost

The FeedbackModal component had a hardcoded URL (http://localhost:5000) which would cause feedback submissions to fail silently when the backend is deployed to any environment other than localhost:5000.

Changed to use process.env.REACT_APP_API_URL with a fallback, consistent with every other API-calling component in the codebase (AuthContext, Analytics, PYQs).

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

@broskell is attempting to deploy a commit to the Lovely Mahour's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant