Skip to content

fix(bulk-predict): mount router so the csv template endpoint is reachable - #1013

Merged
Userunknown84 merged 1 commit into
Userunknown84:mainfrom
Rudra-clrscr:fix/1002-bulk-predict-template-mount
Jul 29, 2026
Merged

fix(bulk-predict): mount router so the csv template endpoint is reachable#1013
Userunknown84 merged 1 commit into
Userunknown84:mainfrom
Rudra-clrscr:fix/1002-bulk-predict-template-mount

Conversation

@Rudra-clrscr

Copy link
Copy Markdown
Contributor

Closes #1002

Problem

backend/routes/bulkPredict.js already correctly defines GET /bulk-predict/template (and its own POST /bulk-predict), but the router
was never required or mounted in server.js, so the template download
404'd.

Fix

A small, surgical 5-line change: require and mount bulkPredict.js at root,
placed after predictionRoutes (which already handles the real, active
POST /bulk-predict implementation). This ordering means
bulkPredict.js's own POST /bulk-predict handler stays shadowed —
intentionally, so this fix doesn't regress the working upload flow — while
its GET /bulk-predict/template, a path predictionRoutes.js doesn't
define, becomes reachable.

Left the now-shadowed duplicate POST /bulk-predict handler in
bulkPredict.js as-is with a comment explaining why; removing it is a
separate cleanup out of scope here.

Verification

node --check and eslint clean (identical to unmodified upstream/main
on both touched files — no new issues). Functional check via curl against
a merged tree combined with fix/backend-boot-crash (needed since
bulkPredictController.js transitively requires a service file that didn't
exist until that PR): GET /bulk-predict/template → 200, real CSV body;
the existing POST /bulk-predict flow unaffected.

Copilot AI review requested due to automatic review settings July 28, 2026 17:18
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Aditya Sharma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added SSoC26 bug Something isn't working labels Jul 28, 2026
@Userunknown84
Userunknown84 merged commit 71e3ed4 into Userunknown84:main Jul 29, 2026
4 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Easy SSoC26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: GET /bulk-predict/template CSV template download is unreachable — backend/routes/bulkPredict.js is never mounted

3 participants