Skip to content

Commit 4f0b089

Browse files
committed
fix test
1 parent 465f940 commit 4f0b089

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

routers/admin/notice.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
package admin
77

88
import (
9+
"strconv"
10+
911
"code.gitea.io/gitea/models"
1012
"code.gitea.io/gitea/modules/base"
1113
"code.gitea.io/gitea/modules/context"
1214
"code.gitea.io/gitea/modules/log"
1315
"code.gitea.io/gitea/modules/setting"
14-
"strconv"
1516
)
1617

1718
const (

routers/api/v1/user/user.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package user
88
import (
99
"fmt"
1010
"net/http"
11-
"strconv"
1211
"strings"
1312

1413
"code.gitea.io/gitea/models"
@@ -58,14 +57,9 @@ func Search(ctx *context.APIContext) {
5857

5958
listOptions := utils.GetListOptions(ctx)
6059

61-
uid, err := strconv.ParseInt(ctx.Query("uid"), 10, 64)
62-
if err != nil {
63-
ctx.Error(http.StatusUnprocessableEntity, "uid", err)
64-
}
65-
6660
opts := &models.SearchUserOptions{
6761
Keyword: strings.Trim(ctx.Query("q"), " "),
68-
UID: uid,
62+
UID: ctx.QueryInt64("uid"),
6963
Type: models.UserTypeIndividual,
7064
ListOptions: listOptions,
7165
}

0 commit comments

Comments
 (0)