setup profile edition
This commit is contained in:
@@ -20,3 +20,15 @@ async def create_user(
|
||||
session.add(user)
|
||||
await session.commit()
|
||||
return user
|
||||
|
||||
|
||||
async def update_user(
|
||||
session: AsyncSession, tg_id: int, fullname: str = "", phone: str = ""
|
||||
) -> None:
|
||||
user = await get_user_by_tg_id(session, tg_id)
|
||||
if fullname:
|
||||
user.fullname = fullname
|
||||
if phone:
|
||||
user.phone = phone
|
||||
await session.commit()
|
||||
return user
|
||||
|
||||
Reference in New Issue
Block a user