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 Delete Method to Project #68

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

Added Delete Method to Project #68

wants to merge 3 commits into from

Conversation

dgiltz
Copy link
Collaborator

@dgiltz dgiltz commented Dec 11, 2020

Closely followed model provided

Summary

Added delete endpoint for user projects

Test Plan

How did you test your changes?

Related Issues

#12

Which issues does this PR resolve/work on?
Closes #11

@celinehuang celinehuang self-requested a review December 12, 2020 19:57
Copy link
Member

@celinehuang celinehuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some small comments. But adding unit tests will be good as well and manual testing through Postman after we are able to populate the database

unit test examples

import uuid

# delete a project
@project.route("/<project_uuid>", METHODS=["DELETE"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this has to be @project.route("/<UUID:project_uuid>", METHODS=["DELETE"])
but to simplify things I think @project.route("/<UUID:id>", METHODS=["DELETE"]) will be good enough

@project.route("/<project_uuid>", METHODS=["DELETE"])
# Login Required
def delete_project(id):
project = Project.query.filter_by(project_id=id).first()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...filter_by(project_id=id)... I think in our tables we store it as id and not project_id

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.

Allow users to delete a project
2 participants