From f6b68be74862c6b9da44879fde1d90506080a7e9 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 27 Feb 2024 01:31:22 +0800 Subject: [PATCH] rearrange NotFound call --- routers/web/explore/user.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/routers/web/explore/user.go b/routers/web/explore/user.go index 81b64bf84253e..0ea4d7613c4a7 100644 --- a/routers/web/explore/user.go +++ b/routers/web/explore/user.go @@ -86,6 +86,7 @@ func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions, } if opts.SupportedSortOrders != nil && !opts.SupportedSortOrders.Contains(sortOrder) { + ctx.NotFound("unsupported sort order", nil) return } @@ -150,11 +151,6 @@ func Users(ctx *context.Context) { ctx.SetFormString("sort", sortOrder) } - if !supportedSortOrders.Contains(sortOrder) { - ctx.NotFound("unsupported sort order", nil) - return - } - RenderUserSearch(ctx, &user_model.SearchUserOptions{ Actor: ctx.Doer, Type: user_model.UserTypeIndividual,