Added backend api functions for to change 'resolve' status in backend #15
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 #3
Added two functions present in
src/api/topics.js
that change the 'resolved' field of the post in the database to true formarkResolved
and false formarkUnresolved
.These functions should be called from the frontend when user manually presses button to toggle the 'resolved' status.
Functions are valid to be called on regardless of the current state of the 'resolved' field (ie. able to call 'markResolved' for a post whose 'resolved' field is already set to True).
Tested with printing to console, once frontend was implemented in pr #28

Wrote automated unit tests in pr #18 to increase coverage
Note: all lint and test do pass when the last commit was made! I just accidentally re-ran it (10/9/2024) and the coveralls failed to run at all because of a configuration problem, as this is a closed issue and completed build. See the successful test and coverage report here: https://github.com/CMU-313/nodebb-f24-team-kale/actions/runs/10984399635/attempts/2