Remove obsolete endpoints (#89)
Remove endpoints api/login/token and api/login/profile --------- Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de> Reviewed-on: #89
This commit is contained in:
@@ -1,12 +1,26 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
from src.db.models.admin import Profile
|
||||
|
||||
|
||||
class ProfileResponse(BaseModel):
|
||||
id: str
|
||||
user_name: str
|
||||
username: str
|
||||
|
||||
|
||||
class ProfileModel(BaseModel):
|
||||
user_name: str
|
||||
username: str
|
||||
email: str
|
||||
first_name: str
|
||||
last_name: str
|
||||
active: bool
|
||||
|
||||
def to_model(profile: Profile) -> ProfileModel:
|
||||
model: ProfileModel = ProfileModel(
|
||||
username=profile.user_name,
|
||||
email=profile.email,
|
||||
first_name=profile.first_name,
|
||||
last_name=profile.last_name,
|
||||
active=profile.enabled,
|
||||
)
|
||||
return model
|
||||
|
||||
Reference in New Issue
Block a user