del old task dep, page start from 1

This commit is contained in:
IluaAir
2025-09-30 00:23:16 +03:00
parent ac28f9b420
commit 41c64127a5
3 changed files with 9 additions and 17 deletions

View File

@@ -1,5 +1,3 @@
from datetime import date
from fastapi import HTTPException
from src.schemas.users import User, UserUpdate, UserWithTasks
@@ -43,7 +41,7 @@ class UserService(BaseService):
async def get_user_with_tasks(self, user_id: int, **attrs):
if attrs.get("page") and attrs.get("limit"):
tasks_offset = attrs.get("page", 0) * attrs.get("limit")
tasks_offset = (attrs.get("page", 0) - 1) * attrs.get("limit")
else:
tasks_offset = None
user = await self.session.user.get_one_with_load(