Skip to content

Commit

Permalink
fix for latest fastapi (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
dni authored Jun 22, 2023
1 parent 2d3e544 commit fc61c15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from http import HTTPStatus

from fastapi import Depends, Query, Request
from fastapi import Depends, Request
from fastapi.templating import Jinja2Templates
from starlette.exceptions import HTTPException

Expand All @@ -21,7 +21,7 @@ async def index(request: Request, user: User = Depends(check_user_exists)):


@tipjar_ext.get("/{tipjar_id}")
async def tip(request: Request, tipjar_id: int = Query(None)):
async def tip(request: Request, tipjar_id: int):
"""Return the donation form for the Tipjar corresponding to id"""
tipjar = await get_tipjar(tipjar_id)
if not tipjar:
Expand Down
9 changes: 5 additions & 4 deletions views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ async def api_get_tips(wallet: WalletTypeInfo = Depends(get_key_type)):
@tipjar_ext.put("/api/v1/tips/{tip_id}")
async def api_update_tip(
data: createTip,
tip_id: str,
wallet: WalletTypeInfo = Depends(get_key_type),
tip_id: str = Query(None),
):
"""Update a tip with the data given in the request"""
if tip_id:
Expand Down Expand Up @@ -153,8 +153,8 @@ async def api_update_tip(
@tipjar_ext.put("/api/v1/tipjars/{tipjar_id}")
async def api_update_tipjar(
data: createTipJar,
tipjar_id: int,
wallet: WalletTypeInfo = Depends(get_key_type),
tipjar_id: int = Query(None),
):
"""Update a tipjar with the data given in the request"""
if tipjar_id:
Expand All @@ -180,7 +180,7 @@ async def api_update_tipjar(

@tipjar_ext.delete("/api/v1/tips/{tip_id}")
async def api_delete_tip(
wallet: WalletTypeInfo = Depends(get_key_type), tip_id: str = Query(None)
tip_id: str, wallet: WalletTypeInfo = Depends(get_key_type)
):
"""Delete the tip with the given tip_id"""
tip = await get_tip(tip_id)
Expand All @@ -201,7 +201,8 @@ async def api_delete_tip(

@tipjar_ext.delete("/api/v1/tipjars/{tipjar_id}")
async def api_delete_tipjar(
wallet: WalletTypeInfo = Depends(get_key_type), tipjar_id: int = Query(None)
tipjar_id: int,
wallet: WalletTypeInfo = Depends(get_key_type)
):
"""Delete the tipjar with the given tipjar_id"""
tipjar = await get_tipjar(tipjar_id)
Expand Down

0 comments on commit fc61c15

Please sign in to comment.