We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 429258c commit 8f821b0Copy full SHA for 8f821b0
web_src/js/index.js
@@ -2233,15 +2233,21 @@ function searchUsers() {
2233
url: `${AppSubUrl}/api/v1/users/search?q={query}`,
2234
onResponse(response) {
2235
const items = [];
2236
+ const searchQuery = $searchUserBox.find('input').val();
2237
$.each(response.data, (_i, item) => {
2238
let title = item.login;
2239
if (item.full_name && item.full_name.length > 0) {
2240
title += ` (${htmlEscape(item.full_name)})`;
2241
}
- items.push({
2242
+ const resultItem = {
2243
title,
2244
image: item.avatar_url
- });
2245
+ };
2246
+ if (searchQuery === item.login) {
2247
+ items.unshift(resultItem);
2248
+ } else {
2249
+ items.push(resultItem);
2250
+ }
2251
});
2252
2253
return {results: items};
0 commit comments