From ed81b608cb5bd94ef518393cdd724c4fac1215d4 Mon Sep 17 00:00:00 2001 From: Tyrone Yeh Date: Sat, 15 Apr 2023 02:48:36 +0800 Subject: [PATCH] Add option to search for users is active join a team (#24093) Adding a user in a team to enter a username gives a list of no active users --------- Co-authored-by: Jason Song --- routers/web/user/search.go | 1 + web_src/js/features/comp/SearchUserBox.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/web/user/search.go b/routers/web/user/search.go index c5c3aa75f0..bdc4116e37 100644 --- a/routers/web/user/search.go +++ b/routers/web/user/search.go @@ -24,6 +24,7 @@ func Search(ctx *context.Context) { Keyword: ctx.FormTrim("q"), UID: ctx.FormInt64("uid"), Type: user_model.UserTypeIndividual, + IsActive: ctx.FormOptionalBool("active"), ListOptions: listOptions, }) if err != nil { diff --git a/web_src/js/features/comp/SearchUserBox.js b/web_src/js/features/comp/SearchUserBox.js index 0e9a005acf..960b787fea 100644 --- a/web_src/js/features/comp/SearchUserBox.js +++ b/web_src/js/features/comp/SearchUserBox.js @@ -11,7 +11,7 @@ export function initCompSearchUserBox() { $searchUserBox.search({ minCharacters: 2, apiSettings: { - url: `${appSubUrl}/user/search?q={query}`, + url: `${appSubUrl}/user/search?active=1&q={query}`, onResponse(response) { const items = []; const searchQuery = $searchUserBox.find('input').val();