Skip to content

Fix recommendation form fetch flow and API handling#507

Open
jayapattar20-tech wants to merge 4 commits into
komalharshita:mainfrom
jayapattar20-tech:fix-view-code-button
Open

Fix recommendation form fetch flow and API handling#507
jayapattar20-tech wants to merge 4 commits into
komalharshita:mainfrom
jayapattar20-tech:fix-view-code-button

Conversation

@jayapattar20-tech

Copy link
Copy Markdown

Summary

Fixed the recommendation form fetch flow and improved frontend API handling for project recommendations. Resolved JavaScript promise chain issues and removed console errors caused by incorrect fetch/catch structure.

Related Issue

Closes #416

Type of Change

  • Bug fix — resolves a broken behaviour

What Was Changed

File Change made
static/script.js Fixed fetch promise chain structure and API handling
static/script.js Improved frontend error handling for recommendation requests
static/script.js Removed JavaScript console errors caused by broken .then() / .catch() flow

How to Test This PR

  1. Clone this branch: git checkout fix-view-code-button
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. Open http://127.0.0.1:5000/
  5. Fill the recommendation form
  6. Click "Generate My Projects"
  7. Verify recommendation API requests complete successfully without console errors

Test Results

python tests/test_basic.py

(Attach your test output here if you ran tests)

Notes for Reviewer

Recommendation data is successfully fetched from the backend API and frontend fetch flow issues were resolved. Further UI rendering behaviour may depend on existing frontend card rendering structure/components.

@vercel

vercel Bot commented May 23, 2026

Copy link
Copy Markdown

@jayapattar20-tech 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.

@github-actions github-actions Bot 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.

Thank you for submitting your first pull request to DevPath.

Before review:

  • Complete the PR template fully
  • Ensure all tests pass
  • Link your PR to an issue
  • Keep changes scoped to the issue

A maintainer will review your contribution soon.

@komalharshita komalharshita left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for fixing the duplicated fetch flow and malformed promise chain — this resolves a real issue currently present in main.

Before merge, please make a few small cleanup changes:

  • Remove temporary debug logs (console.log, raw console.error) from renderResults()
  • Avoid silent try/catch blocks around card rendering unless fallback UI/error handling is added
  • Keep the diff focused on the fetch/API flow cleanup only

After these small refinements, this PR should be good to merge.

@komalharshita komalharshita added type:bug Something isn't working gssoc-2026 level:critical need review Further information is requested quality:clean and removed type:accessibility ui labels May 26, 2026
@jayapattar20-tech

jayapattar20-tech commented May 26, 2026

Copy link
Copy Markdown
Author

Hi @komalharshita ,
Removed the temporary debug logs and cleaned up the render flow as requested. The PR is now focused only on the fetch/API handling fix.

@komalharshita

Copy link
Copy Markdown
Owner

Looks good to merge....but you need to resolve the conflicts @jayapattar20-tech

@jayapattar20-tech

Copy link
Copy Markdown
Author

Hi, @komalharshita
Resolved the merge conflicts and updated the PR. Ready for review. Thank you.

@komalharshita

Copy link
Copy Markdown
Owner

@jayapattar20-tech please check again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Generate My Projects button not working due to JavaScript SyntaxError

2 participants