Skip to content

Sayali: 🔥 change promotion-eligibility endpoint from GET to POST to resolve req.body.requestor undefined issue in production#2201

Merged
one-community merged 1 commit into
developmentfrom
Sayali_Fix_PromotionEligibility_Requestor
May 8, 2026
Merged

Sayali: 🔥 change promotion-eligibility endpoint from GET to POST to resolve req.body.requestor undefined issue in production#2201
one-community merged 1 commit into
developmentfrom
Sayali_Fix_PromotionEligibility_Requestor

Conversation

@sayali-2308
Copy link
Copy Markdown
Contributor

Description

Fixes production bug where Promotion Eligibility table showed "Failed to load Reviewers" error.
The GET /api/promotion-eligibility endpoint was checking req.body.requestor for permissions, but GET requests don't reliably carry a body in production environments, causing req.body.requestor to be undefined and the permission check to fail with 403.
Fix: Changed the endpoint from GET to POST so req.body.requestor is always populated by the auth middleware.

Related PRS (if any):

Frontend PR required: update promotionActions.js to call axios.post instead of axios.get for PROMOTION_ELIGIBILITY endpoint.

Main changes explained:

Updated src/routes/promotionEligibilityRouter.js — changed /promotion-eligibility route from .get() to .post()

How to test:

  1. Check out branch Sayali_Fix_PromotionEligibility_Requestor
  2. Run npm install, npm run build, npm run start
  3. Ensure frontend is running on localhost:5173
  4. Log in as admin
  5. Navigate to localhost:5173/pr-dashboard/promotion-eligibility
  6. Verify table loads with reviewer data (no "Failed to load Reviewers" error)
  7. Verify dark mode works

Screenshots or videos of changes:

image

Note:

This is a backend-only fix. A corresponding frontend PR is needed to change axios.get to axios.post in promotionActions.js.

…e req.body.requestor undefined issue in production
@sayali-2308 sayali-2308 changed the title 0fix: change promotion-eligibility endpoint from GET to POST to resolve req.body.requestor undefined issue in production Sayali: change promotion-eligibility endpoint from GET to POST to resolve req.body.requestor undefined issue in production May 7, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label May 8, 2026
Copy link
Copy Markdown

@HemanthNidamanuru HemanthNidamanuru left a comment

Choose a reason for hiding this comment

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

Hi Sayali,

Thank you for working on this PR. Everything works as expected.

Tested:

  1. Promotion Eligibility page loads reviewer data correctly with no "Failed to load Reviewers" error
  2. Dark mode works as expected
Image Image

@one-community one-community changed the title Sayali: change promotion-eligibility endpoint from GET to POST to resolve req.body.requestor undefined issue in production Sayali: 🔥 change promotion-eligibility endpoint from GET to POST to resolve req.body.requestor undefined issue in production May 8, 2026
@one-community
Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community one-community merged commit 357a9eb into development May 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants