Skip to content

Commit

Permalink
Removed partial POST function so students can complete on own.
Browse files Browse the repository at this point in the history
  • Loading branch information
apradoada committed Dec 9, 2024
1 parent feefd7c commit d571fb9
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions app/routes/pet_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,7 @@

@bp.post("")
def create_pet():
request_body = request.get_json()
try:
new_pet = Pet.from_dict(request_body)
db.session.add(new_pet)
db.session.commit()

return make_response(new_pet.to_dict(), 201)

except KeyError as e:
abort(make_response({"message": f"missing required value: {e}"}, 400))

pass

@bp.get("")
def get_pets():
Expand Down

0 comments on commit d571fb9

Please sign in to comment.