forked from open-webui/open-webui
		
	feat: profile image update backend
This commit is contained in:
		
							parent
							
								
									0e831f4cf7
								
							
						
					
					
						commit
						418da74756
					
				
					 3 changed files with 52 additions and 11 deletions
				
			
		|  | @ -63,6 +63,10 @@ class SigninForm(BaseModel): | |||
|     password: str | ||||
| 
 | ||||
| 
 | ||||
| class ProfileImageUrlForm(BaseModel): | ||||
|     profile_image_url: str | ||||
| 
 | ||||
| 
 | ||||
| class UpdatePasswordForm(BaseModel): | ||||
|     password: str | ||||
|     new_password: str | ||||
|  |  | |||
|  | @ -108,6 +108,20 @@ class UsersTable: | |||
|         except: | ||||
|             return None | ||||
| 
 | ||||
|     def update_user_profile_image_url_by_id( | ||||
|         self, id: str, profile_image_url: str | ||||
|     ) -> Optional[UserModel]: | ||||
|         try: | ||||
|             query = User.update(profile_image_url=profile_image_url).where( | ||||
|                 User.id == id | ||||
|             ) | ||||
|             query.execute() | ||||
| 
 | ||||
|             user = User.get(User.id == id) | ||||
|             return UserModel(**model_to_dict(user)) | ||||
|         except: | ||||
|             return None | ||||
| 
 | ||||
|     def update_user_by_id(self, id: str, updated: dict) -> Optional[UserModel]: | ||||
|         try: | ||||
|             query = User.update(**updated).where(User.id == id) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek