diff options
author | 6543 <6543@obermui.de> | 2021-06-17 16:02:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-17 16:02:34 +0200 |
commit | b3fbd37e992cf3f9f42f49818087c67d464000eb (patch) | |
tree | ddb4aee79d6dfafaa3ff64acffed6f119c222acd /modules | |
parent | 0db1048c3ab0b0802779fd84b86c4335c37e54b3 (diff) | |
download | gitea-b3fbd37e992cf3f9f42f49818087c67d464000eb.tar.gz gitea-b3fbd37e992cf3f9f42f49818087c67d464000eb.zip |
[API] expose repo.GetReviewers() & repo.GetAssignees() (#16168)
* API: expose repo.GetReviewers() & repo.GetAssignees()
* Add tests
* fix unrelated swagger query type
Diffstat (limited to 'modules')
-rw-r--r-- | modules/convert/user.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/convert/user.go b/modules/convert/user.go index c588f5f2f0..07a4efd41a 100644 --- a/modules/convert/user.go +++ b/modules/convert/user.go @@ -25,6 +25,15 @@ func ToUser(user, doer *models.User) *api.User { return toUser(user, signed, authed) } +// ToUsers convert list of models.User to list of api.User +func ToUsers(doer *models.User, users []*models.User) []*api.User { + result := make([]*api.User, len(users)) + for i := range users { + result[i] = ToUser(users[i], doer) + } + return result +} + // ToUserWithAccessMode convert models.User to api.User // AccessMode is not none show add some more information func ToUserWithAccessMode(user *models.User, accessMode models.AccessMode) *api.User { |