feat: check uniqueness for email and phone when updating user (#1461)

* fix: check unique field when update user

* Update data.json

Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
Yaodong Yu
2023-01-10 22:34:08 +08:00
committed by GitHub
parent fcb80b800f
commit ce2a4bbf6e
14 changed files with 76 additions and 18 deletions

View File

@ -148,8 +148,8 @@ func (c *ApiController) UpdateUser() {
return
}
if user.DisplayName == "" {
c.ResponseError(c.T("user:Display name cannot be empty"))
if msg := object.CheckUpdateUser(object.GetUser(id), &user, c.GetAcceptLanguage()); msg != "" {
c.ResponseError(msg)
return
}