mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-21 17:24:10 +00:00
[API] User expose counters (#16167)
This commit is contained in:
parent
9469e14dc6
commit
c9d053f0ca
3 changed files with 25 additions and 0 deletions
|
@ -48,6 +48,10 @@ func toUser(user *models.User, signed, authed bool) *api.User {
|
|||
Location: user.Location,
|
||||
Website: user.Website,
|
||||
Description: user.Description,
|
||||
// counter's
|
||||
Followers: user.NumFollowers,
|
||||
Following: user.NumFollowing,
|
||||
StarredRepos: user.NumStars,
|
||||
}
|
||||
// hide primary email if API caller is anonymous or user keep email private
|
||||
if signed && (!user.KeepEmailPrivate || authed) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue