Skip to content

Commit 19f811f

Browse files
author
Gusted
committed
By default apply minimal mode
1 parent 1444f06 commit 19f811f

File tree

1 file changed

+10
-31
lines changed

1 file changed

+10
-31
lines changed

routers/web/repo/repo.go

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -596,39 +596,18 @@ func SearchRepo(ctx *context.Context) {
596596
return
597597
}
598598

599-
// To query only what's necessary for the dashboard repo list
600-
minimalMode := ctx.FormBool("minimal")
601-
602599
results := make([]*api.Repository, len(repos))
603600
for i, repo := range repos {
604-
if err = repo.GetOwner(ctx); err != nil {
605-
ctx.JSON(http.StatusInternalServerError, api.SearchError{
606-
OK: false,
607-
Error: err.Error(),
608-
})
609-
return
610-
}
611-
if minimalMode {
612-
results[i] = &api.Repository{
613-
ID: repo.ID,
614-
FullName: repo.FullName(),
615-
Fork: repo.IsFork,
616-
Private: repo.IsPrivate,
617-
Template: repo.IsTemplate,
618-
Mirror: repo.IsMirror,
619-
Stars: repo.NumStars,
620-
HTMLURL: repo.HTMLURL(),
621-
Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate,
622-
}
623-
} else {
624-
accessMode, err := models.AccessLevel(ctx.Doer, repo)
625-
if err != nil {
626-
ctx.JSON(http.StatusInternalServerError, api.SearchError{
627-
OK: false,
628-
Error: err.Error(),
629-
})
630-
}
631-
results[i] = convert.ToRepo(repo, accessMode)
601+
results[i] = &api.Repository{
602+
ID: repo.ID,
603+
FullName: repo.FullName(),
604+
Fork: repo.IsFork,
605+
Private: repo.IsPrivate,
606+
Template: repo.IsTemplate,
607+
Mirror: repo.IsMirror,
608+
Stars: repo.NumStars,
609+
HTMLURL: repo.HTMLURL(),
610+
Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate,
632611
}
633612
}
634613

0 commit comments

Comments
 (0)