Expose user.Props through REST API (#7661)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
9d9c737414
Коммит
812f566401
@@ -355,6 +355,9 @@ func TestGetUser(t *testing.T) {
|
|||||||
Client := th.Client
|
Client := th.Client
|
||||||
|
|
||||||
user := th.CreateUser()
|
user := th.CreateUser()
|
||||||
|
user.Props = map[string]string{"testpropkey": "testpropvalue"}
|
||||||
|
|
||||||
|
th.App.UpdateUser(user, false)
|
||||||
|
|
||||||
ruser, resp := Client.GetUser(user.Id, "")
|
ruser, resp := Client.GetUser(user.Id, "")
|
||||||
CheckNoError(t, resp)
|
CheckNoError(t, resp)
|
||||||
@@ -364,6 +367,9 @@ func TestGetUser(t *testing.T) {
|
|||||||
t.Fatal("emails did not match")
|
t.Fatal("emails did not match")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert.NotNil(t, ruser.Props)
|
||||||
|
assert.Equal(t, ruser.Props["testpropkey"], "testpropvalue")
|
||||||
|
|
||||||
ruser, resp = Client.GetUser(user.Id, resp.Etag)
|
ruser, resp = Client.GetUser(user.Id, resp.Etag)
|
||||||
CheckEtag(t, ruser, resp)
|
CheckEtag(t, ruser, resp)
|
||||||
|
|
||||||
|
|||||||
@@ -346,7 +346,6 @@ func (u *User) ClearNonProfileFields() {
|
|||||||
u.MfaSecret = ""
|
u.MfaSecret = ""
|
||||||
u.EmailVerified = false
|
u.EmailVerified = false
|
||||||
u.AllowMarketing = false
|
u.AllowMarketing = false
|
||||||
u.Props = StringMap{}
|
|
||||||
u.NotifyProps = StringMap{}
|
u.NotifyProps = StringMap{}
|
||||||
u.LastPasswordUpdate = 0
|
u.LastPasswordUpdate = 0
|
||||||
u.FailedAttempts = 0
|
u.FailedAttempts = 0
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user