mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-02 18:50:57 +02:00
Pagination Hook (#3494)
* Backend changes for pagination hook + Paginated users table * Frontend changes for pagination hook * Fix invited users endpoint * Fix layout shift & add enter to submit user invites * mypy * Cleanup * Resolve PR concerns & remove UserStatus * Fix errors --------- Co-authored-by: hagen-danswer <hagen@danswer.ai>
This commit is contained in:
@ -6,7 +6,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
|
||||
from onyx.auth.schemas import UserRole
|
||||
from onyx.auth.schemas import UserStatus
|
||||
from onyx.db.models import User
|
||||
|
||||
|
||||
DataT = TypeVar("DataT")
|
||||
@ -35,7 +35,16 @@ class FullUserSnapshot(BaseModel):
|
||||
id: UUID
|
||||
email: str
|
||||
role: UserRole
|
||||
status: UserStatus
|
||||
is_active: bool
|
||||
|
||||
@classmethod
|
||||
def from_user_model(cls, user: User) -> "FullUserSnapshot":
|
||||
return cls(
|
||||
id=user.id,
|
||||
email=user.email,
|
||||
role=user.role,
|
||||
is_active=user.is_active,
|
||||
)
|
||||
|
||||
|
||||
class InvitedUserSnapshot(BaseModel):
|
||||
|
Reference in New Issue
Block a user