Closed ethanbaruh closed 1 month ago
✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.
Package | Version | Score | Details |
---|
Name | Link |
---|---|
Latest commit | 1b9f3afbc4e365446c0ed761c3ad389379a6ac9b |
Latest deploy log | https://app.netlify.com/sites/foodjournal2/deploys/6656476778bac400089768dd |
Some checks were not successful. Maybe do a git pull from the main branch to this branch to fix the issue.
In both router and service file, you can remove the parameter "id: Int" since we only need the access token to get the user id.
- Some checks were not successful. Maybe do a git pull from the main branch to this branch to fix the issue.
This change has been made
- In both router and service file, you can remove the parameter "id: Int" since we only need the access token to get the user id.
The ID in this case is not referring to the user id. This ID is the ID of the post to be removed. I added comments to the endpoint to make this more clear.
Abstract
This PR includes changes to the router endpoints and services to make deleting a post possible. The deletion takes the ID of the post to be deleted and removes it from the MySQL database.
Issues
Closes #37
Type of Change
Testing
Automated tests are in the
backend/tests/testPostModel.py
file and include tests to make sure that posts are removed when the delete method is called. Also included manual testing with the following flow, use login endpoint to get access token, use delete post endpoint with access token, confirm deleting.Checklist