Sayali - feat: Add Backend API for Help Feedback Modal and Request Tracking#2045
Merged
one-community merged 3 commits intodevelopmentfrom Feb 17, 2026
Merged
Conversation
Created help request tracking system and feedback submission API. Includes models, controllers, and routes for feedback modal feature.
Anusha-Gali
approved these changes
Feb 16, 2026
Anusha-Gali
left a comment
There was a problem hiding this comment.
Hi Sayali,
I have reviewed your PR locally and have successfully validated all API responses.
Test case 9
OneCommunityGlobal/HighestGoodNetworkApp#4835 (review)
|
Hi @sayali-2308 Testcase1 |
Member
|
Thank you all, merging! |
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.




















Description
Fixes #15 (PRIORITY URGENT) from HGN Phase I Bugs and Needed Functionalities doc - Backend support for HGN Feedback Modal: Service Worker Registration Failure
Created complete help request tracking system from scratch to enable the feedback modal to auto-trigger 1 week after help requests are made. This system did not exist in the codebase prior to this PR.
Related PRS (if any):
This backend PR is related to the #4835 frontend PR.
To test this backend PR you need to checkout the #4835 frontend PR.
Main changes explained:
src/models/helpRequest.jsfor tracking when users make help requests (includes userId, requestedAt, topic, description, status, feedbackSubmitted fields)src/models/helpFeedback.jsfor storing feedback submissions with member ratings (includes userId, helpRequestId, receivedHelp, activeMembers/inactiveMembers arrays, comments, closedPermanently)src/controllers/helpRequestController.jswith createHelpRequest, checkIfModalShouldShow (1-week trigger logic), updateRequestDate (FOR TESTING ONLY), getAllHelpRequests (FOR TESTING ONLY)src/controllers/helpFeedbackController.jswith submitFeedback (saves feedback and marks help request complete), closePermanently (saves user preference)src/routes/helpRequestRouter.jsfor /api/helprequest endpointssrc/routes/helpFeedbackRouter.jsfor /api/feedback endpointssrc/app.jsto add routes after bodyParser and before other middleware (bypasses auth for these endpoints)How to test:
Sayali_HGN_Feedback_Modal_BackendSayali_HGN_Feedback_Modal_Fixnpm installin backend reponpm run start(runs on port 4500)npm run start:local(runs on port 5173)Test Case 1: Create Help Request API
POST
http://localhost:4500/api/helprequest/createBody (raw JSON):
{ "userId": "69779f8d889b15074b785a02", "topic": "Need help with React", "description": "Having state management issues" }_id,status: "open",feedbackSubmitted: false,requestedAt(current timestamp)Test Case 2: Check Modal Should NOT Show (New Request)
GET
http://localhost:4500/api/helprequest/check-modal/69779f8d889b15074b785a02{"shouldShow": false}Test Case 3: Get All Help Requests (Test Endpoint)
GET
http://localhost:4500/api/helprequest/all_idfrom Test Case 1 responseTest Case 4: Update Date to 1 Week Ago (Test Endpoint)
PUT
http://localhost:4500/api/helprequest/update-dateBody (raw JSON):
{ "helpRequestId": "ID_FROM_TEST_CASE_3", "requestedAt": "2026-02-05T16:27:43.015Z" }requestedAt: "2026-02-05T16:27:43.015Z"Test Case 5: Check Modal SHOULD Show (Old Request)
GET
http://localhost:4500/api/helprequest/check-modal/69779f8d889b15074b785a02{ "shouldShow": true, "helpRequestId": "the_request_id", "requestedAt": "2026-02-05T16:27:43.015Z" }Test Case 6: Submit Feedback API
POST
http://localhost:4500/api/feedback/submitBody (raw JSON):
{ "userId": "69779f8d889b15074b785a02", "helpRequestId": "ID_FROM_TEST_CASE_3", "receivedHelp": "yes", "activeMembers": [ {"name": "Test User", "rating": 3}, {"name": "Another User", "rating": 5} ], "inactiveMembers": [], "comments": "Great help from the team!" }feedbackSubmittedfield should be updated totrueTest Case 7: Modal Should NOT Show After Feedback Submitted
GET
http://localhost:4500/api/helprequest/check-modal/69779f8d889b15074b785a02{"shouldShow": false}Test Case 8: Close Permanently API
POST
http://localhost:4500/api/feedback/close-permanentlyBody (raw JSON):
{ "userId": "69779f8d889b15074b785a02" }closedPermanently: trueTest Case 9: Integration Test with Frontend
http://localhost:5173/hgnhelp/feedbackwith frontend PR checked outScreenshots or videos of changes:
Note:
app.jsBEFORE auth middleware to bypass authentication requirementsupdateRequestDateandgetAllHelpRequestsare marked "FOR TESTING ONLY" - they allow reviewers to test the 1-week trigger logic without waiting an actual week