Permalink
Browse files

dog delete route

  • Loading branch information...
reuben committed Feb 12, 2020
1 parent 2b80e07 commit 34b25d4c2ab4124a3a8aba85c3d6ef6f84efe9ce
Binary file not shown.
BIN +0 Bytes (100%) __pycache__/models.cpython-36.pyc
Binary file not shown.
BIN +0 Bytes (100%) dogs.sqlite
Binary file not shown.
Binary file not shown.
@@ -84,4 +84,17 @@ def create_dog():
), 201


# dog destroy route
@dogs.route('/<id>', methods=['Delete'])
def delete_dog(id):
# you are trying to delete dog with the following id 3
delete_query = models.Dog.delete().where(models.Dog.id == id)
delete_query.execute() # you need this for delete and update
return jsonify(
data={},
message="Successfully deleted dog with id {}".format(id),
status=200
), 200



0 comments on commit 34b25d4

Please sign in to comment.