CSE-112-Team-3 / FoodJournal2.0

our new repository
1 stars 2 forks source link

37 backend setup deleting a post review #49

Closed ethanbaruh closed 1 month ago

ethanbaruh commented 1 month ago

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

github-actions[bot] commented 1 month ago

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

netlify[bot] commented 1 month ago

Deploy Preview for foodjournal2 canceled.

Name Link
Latest commit 1b9f3afbc4e365446c0ed761c3ad389379a6ac9b
Latest deploy log https://app.netlify.com/sites/foodjournal2/deploys/6656476778bac400089768dd
lkimdaryl commented 1 month ago
ethanbaruh commented 1 month ago
  • 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.