@@ -596,39 +596,18 @@ func SearchRepo(ctx *context.Context) {
596
596
return
597
597
}
598
598
599
- // To query only what's necessary for the dashboard repo list
600
- minimalMode := ctx .FormBool ("minimal" )
601
-
602
599
results := make ([]* api.Repository , len (repos ))
603
600
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 ,
632
611
}
633
612
}
634
613
0 commit comments