get one with load

This commit is contained in:
IluaAir
2025-08-15 15:47:58 +03:00
parent 9e5cde8e28
commit a9997b1207
5 changed files with 27 additions and 9 deletions

View File

@@ -38,3 +38,8 @@ class UserService(BaseService):
)
await self.session.commit()
return User.model_validate(user)
async def get_user_with_tasks(self, user_id: int):
user = await self.session.user.get_one_with_load(user_id)
if user is None:
raise HTTPException(status_code=404, detail="User not found.")