Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[READY FOR REVIEW] Backend API for Filtering Unanswered Questions #18

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

Misterurias
Copy link
Contributor

@Misterurias Misterurias commented Feb 27, 2025

📝 Context

This PR introduces the backend API for filtering unanswered questions. This feature will be useful for instructors and TAs which questions from students still require help, and can make the NodeBB process smoother and more efficient.

✅ Changes in Codebase

Modified Files:

  • src/api/unanswered.js
  • src/controllers/topics.js
  • src/routes/api.js
  • src/privileges/users.js
  • src/request.js
  • public/openapi/read.yaml
  • test/.eslintrc
  • test/controllers.js
  • test/topics.js
  • test/utils.js

Created Files:

  • src/api/unanswered.js

🧠 Summary of Changes

The correct topicsController for unanswered questions and its corresponding route was created in src/controllers/topics.js and src/routes/api.js respectively; unit tests and integration tests can be found in test/controllers.js and test/topics.js respectively.

All additional files were changed for data validation and to match testing outputs format to database output formats.

Full unit and integration tests are completed and passed in this PR.

sophiazhuu and others added 13 commits February 26, 2025 23:00
…et unanswered questions api completely working
…trollers and installed new jest framework reflected in package.json
…ed test/controllers/topics.js to modify formatting of output to adhere to schema expectations. changed public/openapi/read.yaml to add definition of unanswered api
…/controllers.js and deleted the created directory of test/controllers/ because it was not synced properly with other tests; also fixed all lint issues. added chai to devDependencies in package.json
…id as a parameter to check for admin privileges before allowing filtering for unanswered questions
roller again to log clearer console errors. completed full integration tests and c
reated new file in src/api/unanswered.js
…routes/api.js to correctly connect with the db. modified test file to correctly match output. code coverage reached all yellow
…sues + Edited unit tests in test/controllers.js + Edited getUnansweredTopics function in src/controllers/topics.js to include numThumbs and thumbs field within return array
@sophiazhuu sophiazhuu changed the title Unanswered questions backend [READY FOR REVIEW] Backend API for Filtering Unanswered Questions Feb 27, 2025
@Ginka3
Copy link
Contributor

Ginka3 commented Feb 28, 2025

Great work on implementing the unanswered questions filter API! Looks well-structured and the refactored response format improves consistency

@SubtoFelix
Copy link
Contributor

The unanswered questions filter API and all the backend code look comprehensive and correct! The tests also seem to cover all the necessary functionalities. Overall, everything looks good, and the pull request is very clear and understandable.

…to show that what she had originally worked in both functionality and testing but was not passing lint + node tests due to external modules used
…to show that what she had originally worked in both functionality and testing but was not passing lint + node tests due to external modules used. Got rid of comments in her code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants