mirror of
				https://github.com/gitbucket/gitbucket.git
				synced 2025-10-30 18:15:59 +01:00 
			
		
		
		
	modify fields to option
This commit is contained in:
		| @@ -1,11 +1,11 @@ | |||||||
| package gitbucket.core.api | package gitbucket.core.api | ||||||
|  |  | ||||||
| case class UpdateAUser( | case class UpdateAUser( | ||||||
|   name: String, |   name: Option[String], | ||||||
|   email: String, |   email: Option[String], | ||||||
|   blog: String, |   blog: Option[String], | ||||||
|   company: String, |   company: Option[String], | ||||||
|   location: String, |   location: Option[String], | ||||||
|   hireable: Boolean, |   hireable: Option[Boolean], | ||||||
|   bio: String |   bio: Option[String] | ||||||
| ) | ) | ||||||
|   | |||||||
| @@ -38,9 +38,9 @@ trait ApiUserControllerBase extends ControllerBase { | |||||||
|     (for { |     (for { | ||||||
|       data <- extractFromJsonBody[UpdateAUser] |       data <- extractFromJsonBody[UpdateAUser] | ||||||
|     } yield { |     } yield { | ||||||
|       val updatedAccount = context.loginAccount.get.copy( |       val loginAccount = context.loginAccount.get | ||||||
|         mailAddress = data.email, |       val updatedAccount = loginAccount.copy( | ||||||
|         description = Some(data.bio) |         mailAddress = data.email.getOrElse(loginAccount.mailAddress) | ||||||
|       ) |       ) | ||||||
|       updateAccount(updatedAccount) |       updateAccount(updatedAccount) | ||||||
|       JsonFormat(ApiUser(updatedAccount)) |       JsonFormat(ApiUser(updatedAccount)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user