mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 14:00:04 +02:00
Assignee back end
This commit is contained in:
parent
a03f380fa8
commit
e867283406
8 changed files with 96 additions and 46 deletions
|
@ -713,8 +713,8 @@ func GetRepositoryCount(user *User) (int64, error) {
|
|||
return orm.Count(&Repository{OwnerId: user.Id})
|
||||
}
|
||||
|
||||
// GetCollaborators returns a list of user name of repository's collaborators.
|
||||
func GetCollaborators(repoName string) ([]string, error) {
|
||||
// GetCollaboratorNames returns a list of user name of repository's collaborators.
|
||||
func GetCollaboratorNames(repoName string) ([]string, error) {
|
||||
accesses := make([]*Access, 0, 10)
|
||||
if err := orm.Find(&accesses, &Access{RepoName: strings.ToLower(repoName)}); err != nil {
|
||||
return nil, err
|
||||
|
@ -727,6 +727,23 @@ func GetCollaborators(repoName string) ([]string, error) {
|
|||
return names, nil
|
||||
}
|
||||
|
||||
// GetCollaborators returns a list of users of repository's collaborators.
|
||||
func GetCollaborators(repoName string) (us []*User, err error) {
|
||||
accesses := make([]*Access, 0, 10)
|
||||
if err = orm.Find(&accesses, &Access{RepoName: strings.ToLower(repoName)}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
us = make([]*User, len(accesses))
|
||||
for i := range accesses {
|
||||
us[i], err = GetUserByName(accesses[i].UserName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
return us, nil
|
||||
}
|
||||
|
||||
// Watch is connection request for receiving repository notifycation.
|
||||
type Watch struct {
|
||||
Id int64
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue