From 4d632ed0425cdabd1c74c7282e9cfd354028c1b5 Mon Sep 17 00:00:00 2001 From: Hoang Date: Mon, 29 Nov 2021 10:01:04 +0700 Subject: [PATCH] update UserRes --- model/user_response.go | 21 +++++++++++---------- user/handle.go | 9 +++++---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/model/user_response.go b/model/user_response.go index b6bf148..7480bf3 100644 --- a/model/user_response.go +++ b/model/user_response.go @@ -6,16 +6,17 @@ import ( // User ... type User struct { - ID string `json:"_id"` - Name string `json:"name"` - Phone string `json:"phone"` - Email string `json:"email"` - Status string `json:"status"` - Role RoleShort `json:"role"` - Other interface{} `json:"other"` - Avatar interface{} `json:"avatar"` - CreatedAt time.Time `json:"createdAt"` - UpdatedAt time.Time `json:"updatedAt"` + ID string `json:"_id"` + Name string `json:"name"` + Phone string `json:"phone"` + Email string `json:"email"` + Status string `json:"status"` + Role RoleShort `json:"role"` + RequireToChangePassword bool `json:"requireToChangePassword"` + Other interface{} `json:"other"` + Avatar interface{} `json:"avatar"` + CreatedAt time.Time `json:"createdAt"` + UpdatedAt time.Time `json:"updatedAt"` } type ( diff --git a/user/handle.go b/user/handle.go index 614d5c6..3286736 100644 --- a/user/handle.go +++ b/user/handle.go @@ -179,10 +179,11 @@ func getResponse(ctx context.Context, user model.DBUser) model.User { Level: roleRaw.Level, IsAdmin: roleRaw.IsAdmin, }, - Avatar: user.Avatar, - Other: user.Other, - CreatedAt: user.CreatedAt, - UpdatedAt: user.UpdatedAt, + RequireToChangePassword: user.RequireToChangePassword, + Avatar: user.Avatar, + Other: user.Other, + CreatedAt: user.CreatedAt, + UpdatedAt: user.UpdatedAt, } }