Skip to content

Commit 7d122f7

Browse files
committed
fix
1 parent 700a2d4 commit 7d122f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/api/stuff.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ async def find_stuff_pool(
8484
HTTPException: If the 'Stuff' object is not found or an SQLAlchemyError occurs.
8585
"""
8686
try:
87-
stmt = await Stuff.find(db_session, name, compile_sql=True)
87+
stmt = await Stuff.get_by_name(db_session, name, compile_sql=True)
8888
result = await request.app.postgres_pool.fetchrow(str(stmt))
8989
except SQLAlchemyError as ex:
9090
raise HTTPException(
@@ -100,7 +100,7 @@ async def find_stuff_pool(
100100

101101
@router.delete("/{name}")
102102
async def delete_stuff(name: str, db_session: AsyncSession = Depends(get_db)):
103-
stuff = await Stuff.find(db_session, name)
103+
stuff = await Stuff.get_by_name(db_session, name)
104104
return await Stuff.delete(stuff, db_session)
105105

106106

@@ -110,6 +110,6 @@ async def update_stuff(
110110
name: str,
111111
db_session: AsyncSession = Depends(get_db),
112112
):
113-
stuff = await Stuff.find(db_session, name)
113+
stuff = await Stuff.get_by_name(db_session, name)
114114
await stuff.update(**payload.model_dump())
115115
return stuff

0 commit comments

Comments
 (0)