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

Added backend api functions for to change 'resolve' status in backend #15

Merged
merged 3 commits into from
Sep 22, 2024

Conversation

goelaine
Copy link

@goelaine goelaine commented Sep 22, 2024

Fixes #3
Added two functions present in src/api/topics.js that change the 'resolved' field of the post in the database to true for markResolved and false for markUnresolved.
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
image

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

image

@goelaine goelaine merged commit e8c5cf0 into CMU-313:f24 Sep 22, 2024
1 check passed
@coveralls
Copy link

coveralls commented Sep 22, 2024

Pull Request Test Coverage Report for Build 10984399635

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 2 of 6 (33.33%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 81.818%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/api/topics.js 2 6 33.33%
Files with Coverage Reduction New Missed Lines %
src/meta/errors.js 1 76.74%
Totals Coverage Status
Change from base Build 10983572388: -0.01%
Covered Lines: 22345
Relevant Lines: 25869

💛 - Coveralls

@goelaine
Copy link
Author

Screenshot 2024-09-29 at 14 33 13

Now covered with new test cases in pr #29

@goelaine goelaine restored the backendApiIssue branch October 9, 2024 22:36
@goelaine goelaine deleted the backendApiIssue branch October 9, 2024 23:08
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.

US1-2: Backend API Changes to Handle Status Updates
2 participants