Skip to content

Sayali: replace hardcoded API URL with ENDPOINTS and improve network err…#5201

Open
sayali-2308 wants to merge 1 commit intodevelopmentfrom
Sayali_Fix_HelpModal_Network_Error
Open

Sayali: replace hardcoded API URL with ENDPOINTS and improve network err…#5201
sayali-2308 wants to merge 1 commit intodevelopmentfrom
Sayali_Fix_HelpModal_Network_Error

Conversation

@sayali-2308
Copy link
Copy Markdown
Contributor

Description

Fixes #22 (Priority Medium) - Follow-up fix for HGN Questionnaire Dashboard: Help Request Submission

Related PRs:

Follow-up to merged PR #4844 (Sayali - Add: Success and Error Feedback to Help Request Submission)

Main changes explained:

  • Replaced hardcoded http://localhost:4500/api/helprequest/create URL with ENDPOINTS.HELP_REQUEST_CREATE in HelpModal.jsx
  • Added HELP_REQUEST_CREATE endpoint to src/utils/URL.js
  • Improved error handling to distinguish network errors from API errors in HelpModal.jsx

How to test:

  1. Checkout branch Sayali_Fix_HelpModal_Network_Error
  2. npm install and npm run start:local
  3. Clear site data/cache, log in as admin
  4. Navigate to /hgnhelp
  5. With backend running: select category, submit → verify success toast appears
  6. With backend stopped: verify "Failed to load help categories" shows, Submit button disabled

##Screenshots

  1. Backend running → success toast "Help request submitted successfully!"
image

2.Backend stopped → modal showing "Failed to load help categories" + disabled Submit button
image

Note:

This fixes the reviewer's reported issue where "Failed to submit" error appeared when backend was stopped, caused by hardcoded localhost URL bypassing the Vite proxy.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 26, 2026

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 620d41e
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/69ed5ee6cc24940008cabf78
😎 Deploy Preview https://deploy-preview-5201--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud
Copy link
Copy Markdown

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