fix: remove duplicate fetch call in form submit handler#533
Merged
komalharshita merged 1 commit intoMay 26, 2026
Merged
Conversation
|
@akhilmodi29 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
@komalharshita Please review this PR and add the required labels including gssoc:approved. This fixes the duplicate fetch call bug in the form submit handler. Labels suggested:
|
komalharshita
approved these changes
May 26, 2026
Owner
komalharshita
left a comment
There was a problem hiding this comment.
Good cleanup and bugfix contribution.
You correctly identified that the form submit handler contained a duplicated/unreachable fetch('/api/recommend') block and removed the redundant logic cleanly.
Things done well:
- Removes dead/unreachable code
- Simplifies request flow and error handling
- Improves readability and maintainability
- Keeps the valid request flow intact
- Properly scoped low-risk fix
This looks good to merge. 🚀
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #532
Problem
The form submit handler in static/script.js had the
fetch("/api/recommend") call written twice:
This caused:
Fix
Removed the duplicate fetch block including the duplicate
payload variable declaration and the unreachable
if (data.error) and renderResults() calls.
Testing