Skip to content

Commit

Permalink
♻️ Refactor user update functions and schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
rapeeza1598 committed May 1, 2024
1 parent c5bffaf commit 9220510
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/crud/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def update_user(db: Session, user_id: str, user: updateUser):

def update_user_by_super_admin(db: Session, user_id: str, user: updateUserBySuperAdmin):
db_user = db.query(User).filter(User.id == user_id).first() # type: ignore
list_data = ["firstName", "lastName", "phoneNumber", "role", "is_active"]
list_data = ["firstName", "lastName", "phoneNumber","email", "role", "is_active"]
try:
for data in list_data:
if hasattr(user, data):
Expand Down
1 change: 1 addition & 0 deletions app/schemas/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class updateUserBySuperAdmin(BaseModel):
firstName: Optional[str]
lastName: Optional[str]
phoneNumber: Optional[str]
email: Optional[str]
role: Optional[str]
is_active: Optional[bool]

Expand Down

0 comments on commit 9220510

Please sign in to comment.