Skip to content

Commit

Permalink
Actualizando nombres para documentación
Browse files Browse the repository at this point in the history
  • Loading branch information
luceldasilva committed Feb 24, 2023
1 parent d10f4fc commit 9843f0b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions routers/kc_cup_feb_23.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ def search_user(duelist: int):


@kcfeb23.get("/", response_model=list[User])
async def users():
async def all_duelists():
return users_schema(db_client.users.find())


@kcfeb23.get("/{duelist}")
async def user(duelist: int):
async def searching_by_duelist(duelist: int):
return search_user(duelist)


@kcfeb23.post("/", response_model=User, status_code=status.HTTP_201_CREATED)
async def user(user: User):
async def create_duelist(user: User):
if type(search_user(user.duelist)) == User:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Ey, el usuario ya existe")

Expand All @@ -41,7 +41,7 @@ async def user(user: User):


@kcfeb23.delete("/{duelist}", status_code=status.HTTP_204_NO_CONTENT)
async def user(duelist: int):
async def drop_duelist(duelist: int):

found = db_client.users.find_one_and_delete({"duelist": duelist})

Expand All @@ -50,7 +50,7 @@ async def user(duelist: int):


@kcfeb23.patch("/", response_model=User)
async def user(user: UserUpdate):
async def update_duelist(user: UserUpdate):

if not type(search_user(user.duelist)) == User:
raise HTTPException(status_code=404, detail="Ese usuario no existe")
Expand Down

0 comments on commit 9843f0b

Please sign in to comment.