fix(api): return real total for user pagination
Generic Container CI/CD / test-build-publish (push) Successful in 2m13s
Server CI/CD v2 / build-test-publish-and-deploy (push) Successful in 2m13s

This commit is contained in:
2026-09-15 10:55:29 +08:00
parent 682c26fddd
commit a3b4e75317
3 changed files with 35 additions and 3 deletions
@@ -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,
*,