fix(api): return real total for user pagination
This commit is contained in:
@@ -4,7 +4,7 @@ from typing import Optional, List
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from cryptography.fernet import InvalidToken
|
||||
from sqlalchemy import delete, select
|
||||
from sqlalchemy import delete, func, select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.core.encryption import (
|
||||
@@ -122,6 +122,12 @@ class MetadataRepository:
|
||||
)
|
||||
return list(result.scalars().all())
|
||||
|
||||
async def count_users(self) -> int:
|
||||
result = await self.session.execute(
|
||||
select(func.count()).select_from(models.User)
|
||||
)
|
||||
return int(result.scalar() or 0)
|
||||
|
||||
async def upsert_user_from_keycloak(
|
||||
self,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user