fix(user): unify email validation for registration and settings (#39304)

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Abhay Pratap Singh
2026-09-16 17:34:41 +00:00
committed by GitHub
co-authored by silverwind wxiaoguang
parent c6c671e113
commit 7ebb2caa9e
21 changed files with 138 additions and 209 deletions
+2 -2
View File
@@ -76,7 +76,7 @@ func TestAPIAddEmail(t *testing.T) {
req := NewRequestWithJSON(t, "POST", "/api/v1/user/emails", &opts).
AddTokenAuth(token)
MakeRequest(t, req, http.StatusUnprocessableEntity)
MakeRequest(t, req, http.StatusConflict)
opts = api.CreateEmailOption{
Emails: []string{"user2-3@example.com"},
@@ -109,7 +109,7 @@ func TestAPIAddEmail(t *testing.T) {
}
req = NewRequestWithJSON(t, "POST", "/api/v1/user/emails", &opts).
AddTokenAuth(token)
MakeRequest(t, req, http.StatusUnprocessableEntity)
MakeRequest(t, req, http.StatusBadRequest)
}
func TestAPIDeleteEmail(t *testing.T) {