Add user update ability
This commit is contained in:
+8
-5
@@ -26,7 +26,7 @@ class User(UserBase):
|
||||
updated_at: datetime = Field(
|
||||
description="Last update timestamp", examples=["2025-01-01T00:00:00.000Z"]
|
||||
)
|
||||
|
||||
|
||||
@property
|
||||
def has_logged_in(self) -> bool:
|
||||
"""Returns True if the user has ever logged in, False if last_login is the epoch date."""
|
||||
@@ -46,9 +46,12 @@ class UserLogin(UserBase):
|
||||
password: str = Field(description="Password of the user", examples=["sn1rbul4"])
|
||||
|
||||
|
||||
class UserChangePassword(BaseModel):
|
||||
class UpdateUser(BaseModel):
|
||||
id: int = Field(description="ID of the user", examples=[1])
|
||||
old_password: str = Field(
|
||||
description="Old password of the user", examples=["sn1rbul4"]
|
||||
avatar_id: int | None = Field(None, description="ID of the avatar", examples=[1])
|
||||
email: str | None = Field(
|
||||
None, description="Email of the user", examples=["[email protected]"]
|
||||
)
|
||||
password: str | None = Field(
|
||||
None, description="Password of the user", examples=["p1p4l1"]
|
||||
)
|
||||
password: str = Field(description="Password of the user", examples=["p1p4l1"])
|
||||
|
||||
Reference in New Issue
Block a user