diff options
author | KN4CK3R <KN4CK3R@users.noreply.github.com> | 2021-05-01 11:05:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-01 10:05:55 +0100 |
commit | 67e10397af909a6f6b36000e2e4b5e3a95641832 (patch) | |
tree | 54e3f5d95a6fc9a15947536f538a3a0204caa0d0 /modules/convert/user.go | |
parent | 5811e162ae7257ea85a910266dc3cb94a9e6472c (diff) | |
download | gitea-67e10397af909a6f6b36000e2e4b5e3a95641832.tar.gz gitea-67e10397af909a6f6b36000e2e4b5e3a95641832.zip |
Add Location, Website and Biography to API (#15675)
Diffstat (limited to 'modules/convert/user.go')
-rw-r--r-- | modules/convert/user.go | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/modules/convert/user.go b/modules/convert/user.go index f3a33aee41..364914f2ad 100644 --- a/modules/convert/user.go +++ b/modules/convert/user.go @@ -38,13 +38,16 @@ func ToUserWithAccessMode(user *models.User, accessMode models.AccessMode) *api. // signed shall only be set if requester is logged in. authed shall only be set if user is site admin or user himself func toUser(user *models.User, signed, authed bool) *api.User { result := &api.User{ - ID: user.ID, - UserName: user.Name, - FullName: markup.Sanitize(user.FullName), - Email: user.GetEmail(), - AvatarURL: user.AvatarLink(), - Created: user.CreatedUnix.AsTime(), - Restricted: user.IsRestricted, + ID: user.ID, + UserName: user.Name, + FullName: markup.Sanitize(user.FullName), + Email: user.GetEmail(), + AvatarURL: user.AvatarLink(), + Created: user.CreatedUnix.AsTime(), + Restricted: user.IsRestricted, + Location: user.Location, + Website: user.Website, + Description: user.Description, } // hide primary email if API caller is anonymous or user keep email private if signed && (!user.KeepEmailPrivate || authed) { |