pass repo to remote perm func (#653)

* pass repo to remote perm func

* go:generate mockery

Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
Anbraten
2022-01-03 15:33:36 +01:00
committed by GitHub
parent a2429eb570
commit f7d1451ca3
17 changed files with 53 additions and 46 deletions

View File

@@ -213,8 +213,8 @@ func (c *Coding) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error
// Perm fetches the named repository permissions from
// the remote system for the specified user.
func (c *Coding) Perm(ctx context.Context, u *model.User, owner, repo string) (*model.Perm, error) {
project, err := c.newClient(ctx, u).GetProject(owner, repo)
func (c *Coding) Perm(ctx context.Context, u *model.User, repo *model.Repo) (*model.Perm, error) {
project, err := c.newClient(ctx, u).GetProject(repo.Owner, repo.Name)
if err != nil {
return nil, err
}