From b9db9fa15e3a22e825c949f160613e7a885ec1c2 Mon Sep 17 00:00:00 2001 From: Nazar Gargol Date: Fri, 21 Feb 2020 16:00:13 +0800 Subject: [PATCH] Allowed editing member's email no issue - After investigating effects of allowing editing email there were no significant blockers found, so there is no reason not to allow editing this field --- .../utils/validators/input/schemas/members-edit.json | 9 ++++++--- core/test/regression/api/canary/admin/members_spec.js | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/server/api/canary/utils/validators/input/schemas/members-edit.json b/core/server/api/canary/utils/validators/input/schemas/members-edit.json index bed8763566..bf0744747e 100644 --- a/core/server/api/canary/utils/validators/input/schemas/members-edit.json +++ b/core/server/api/canary/utils/validators/input/schemas/members-edit.json @@ -20,6 +20,12 @@ "maxLength": 191, "pattern": "^([^,]|$)" }, + "email": { + "type": "string", + "minLength": 1, + "maxLength": 191, + "pattern": "^([^,]|$)" + }, "note": { "type": "string", "minLength": 0, @@ -34,9 +40,6 @@ "id": { "strip": true }, - "email": { - "strip": true - }, "labels": { "$ref": "members#/definitions/member-labels" }, diff --git a/core/test/regression/api/canary/admin/members_spec.js b/core/test/regression/api/canary/admin/members_spec.js index ed517d38b7..326f98c274 100644 --- a/core/test/regression/api/canary/admin/members_spec.js +++ b/core/test/regression/api/canary/admin/members_spec.js @@ -168,8 +168,8 @@ describe('Members API', function () { jsonResponse.members.should.have.length(1); localUtils.API.checkResponse(jsonResponse.members[0], 'member', 'stripe'); jsonResponse.members[0].name.should.equal(memberChanged.name); - jsonResponse.members[0].email.should.not.equal(memberChanged.email); - jsonResponse.members[0].email.should.equal(memberToChange.email); + jsonResponse.members[0].email.should.equal(memberChanged.email); + jsonResponse.members[0].email.should.not.equal(memberToChange.email); }); }); });