From 619608ea7aa3314f5918ce48998cd80d4d6bd34f Mon Sep 17 00:00:00 2001 From: shpuld Date: Thu, 18 Jul 2019 17:22:51 +0300 Subject: [PATCH] fix issues caused by merges in usersearch on @ --- src/components/emoji-input/suggestor.js | 2 +- src/services/api/api.service.js | 16 +++++++++++++++- .../backend_interactor_service.js | 4 +++- static/gtr.png | Bin 0 -> 4300 bytes static/shpposter_club.jpg | Bin 0 -> 182566 bytes 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 static/gtr.png create mode 100644 static/shpposter_club.jpg diff --git a/src/components/emoji-input/suggestor.js b/src/components/emoji-input/suggestor.js index 6d97c5c9..aec5c39d 100644 --- a/src/components/emoji-input/suggestor.js +++ b/src/components/emoji-input/suggestor.js @@ -13,7 +13,7 @@ import { debounce } from 'lodash' const debounceUserSearch = debounce((data, input) => { data.updateUsersList(input) -}, 500, {leading: true, trailing: false}) +}, 500, { leading: true, trailing: false }) export default data => input => { const firstChar = input[0] diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 2de1c3b7..d4ad1c4e 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -68,6 +68,7 @@ const MASTODON_REPORT_USER_URL = '/api/v1/reports' const MASTODON_PIN_OWN_STATUS = id => `/api/v1/statuses/${id}/pin` const MASTODON_UNPIN_OWN_STATUS = id => `/api/v1/statuses/${id}/unpin` const MASTODON_SEARCH_2 = `/api/v2/search` +const MASTODON_USER_SEARCH_URL = '/api/v1/accounts/search' const oldfetch = window.fetch @@ -853,6 +854,18 @@ const reportUser = ({ credentials, userId, statusIds, comment, forward }) => { }) } +const searchUsers = ({ credentials, query }) => { + return promisedRequest({ + url: MASTODON_USER_SEARCH_URL, + params: { + q: query, + resolve: true + }, + credentials + }) + .then((data) => data.map(parseUser)) +} + const search2 = ({ credentials, q, resolve, limit, offset, following }) => { let url = MASTODON_SEARCH_2 let params = [] @@ -960,7 +973,8 @@ const apiService = { fetchRebloggedByUsers, reportUser, updateNotificationSettings, - search2 + search2, + searchUsers } export default apiService diff --git a/src/services/backend_interactor_service/backend_interactor_service.js b/src/services/backend_interactor_service/backend_interactor_service.js index 4f067df9..bdfe0465 100644 --- a/src/services/backend_interactor_service/backend_interactor_service.js +++ b/src/services/backend_interactor_service/backend_interactor_service.js @@ -150,6 +150,7 @@ const backendInteractorService = credentials => { const unretweet = (id) => apiService.unretweet({ id, credentials }) const search2 = ({ q, resolve, limit, offset, following }) => apiService.search2({ credentials, q, resolve, limit, offset, following }) + const searchUsers = (query) => apiService.searchUsers({ query, credentials }) const backendInteractorServiceInstance = { fetchStatus, @@ -212,7 +213,8 @@ const backendInteractorService = credentials => { retweet, unretweet, updateNotificationSettings, - search2 + search2, + searchUsers } return backendInteractorServiceInstance diff --git a/static/gtr.png b/static/gtr.png new file mode 100644 index 0000000000000000000000000000000000000000..70bed92af0dc80e07c5fefda0a337c91b2552086 GIT binary patch literal 4300 zcmc&&`8O2)_nsMp(AbwOV<*{)Y-P__#x@bMMKrRFERB5_vQ1)ap#_EPA-finP*NBS z#ze@HBxXd6{WI_X;d{>ayzYJ7bDp2>eO~80_c^coS8dH9>>}&{0008FfY~!@!hd;+ zg>m;9cztCQ7H=za7~tf;^SrAnkAbj-Sh(B;090lEOJG!mVFUwYMZ;}OSr=K^AaV+3 z&2OCj)}m2 z$V9W7SG^gMe{A@`|HM8X@z1Zf>zt3w{2Rw(0^&vM@>3G?enDw&;&3qQE1}MM^T*se zAPh&8h|cT#tP@x?u5&ki?Wmi{$SeO_69;|hVQg=mKJ#giA;+Q0g)ymKrea$P3YTbd zZZ{q)Fdb_6s;xh~&SXq;0uYJ5><`v?#RjJl&ynX?-o@pA%QkB_DPFC93iuM_`SuGm zJTNWObHiH7swbesP^@k?dRcRqc0cxe?^(R5obGzloLfreI%|9-IrHaMm3SD}Gv`Mv ze(@(7mou(W*HD7$*#ox+mYR|KcaiPeq>eZaCPOsjapH`-<6(p^`kj!@`j#Ai zD=fi;hAI|Z-NtNU+}l|FE#2<3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