fix: recommendations refresh endpoint always returns 400, silent error swallowing#447
Open
Xenon010101 wants to merge 1 commit into
Open
fix: recommendations refresh endpoint always returns 400, silent error swallowing#447Xenon010101 wants to merge 1 commit into
Xenon010101 wants to merge 1 commit into
Conversation
Fixes ItsVikasA#441 Backend: - Added 'refresh' feedbackType handler in POST /api/recommendations that invalidates cache and returns success without requiring courseId Frontend: - Added else clause in handleFeedback to show error toast when response.ok is false, preventing silent failures
Contributor
|
@Xenon010101 is attempting to deploy a commit to the Vikas' projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Hi maintainer! This PR has been open for a while — just a friendly nudge for review when you get a chance. Thanks! |
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 #441
Bugs Fixed
1. Refresh button always failed (400)
The frontend sent
courseId: null+feedbackType: "refresh"but the backend required a non-nullcourseId, returning 400 for every refresh attempt.Fix: Added
refreshhandling inPOST /api/recommendationsthat invalidates the cache and returns success without requiringcourseId.2. Silent error swallowing on refresh failure
The frontend
handleFeedbackhad noelseclause onresponse.ok, so HTTP errors were silently ignored. Users would click refresh, see no feedback, and the recommendations would not update.Fix: Added
elseblock that parses the error response and shows a toast with the actual error message.Testing