get one with load
This commit is contained in:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user