Skip to content

Commit

Permalink
Skip returning apidata in get item route
Browse files Browse the repository at this point in the history
  • Loading branch information
fulder committed Oct 30, 2021
1 parent 1701058 commit 4fc8ede
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lambdas/api/watch_histories/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_item(request: Request, api_name: str, api_id: str):
return routes.get_item(request.state.username, api_name, api_id)


@app.delete("/watch-histories/item/{api_name}/{api_id}")
@app.delete("/watch-histories/item/{api_name}/{api_id}", status_code=204)
def delete_item(request: Request, api_name: str, api_id: str):
return routes.delete_item(request.state.username, api_name, api_id)

Expand Down
5 changes: 2 additions & 3 deletions src/lambdas/api/watch_histories/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def get_item(username, api_name, api_id):
try:
if api_name == "tvmaze":
api_ret = tvmaze_api.get_show(api_id)
tvmaze_api.get_show(api_id)
else:
raise HTTPException(status_code=501)
except tvmaze.HTTPError as e:
Expand All @@ -25,7 +25,7 @@ def get_item(username, api_name, api_id):
api_name,
api_id,
)
return {**w_ret, api_name: {**api_ret}}
return w_ret
except watch_history_db.NotFoundError:
raise HTTPException(status_code=404)

Expand Down Expand Up @@ -73,4 +73,3 @@ def delete_item(username, api_name, api_id):
api_id,
)
watch_history_db.delete_item(username, collection_name, item_id)
return {"statusCode": 204}

0 comments on commit 4fc8ede

Please sign in to comment.