diff options
| author | shpuld <shp@cock.li> | 2019-07-18 17:22:51 +0300 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-07-18 17:22:51 +0300 |
| commit | 619608ea7aa3314f5918ce48998cd80d4d6bd34f (patch) | |
| tree | 86f0108d382c42440f7648983462764afb7b381e | |
| parent | 029dc7405ec5bb7a99724d6307d0316d5d0cb8c2 (diff) | |
fix issues caused by merges in usersearch on @
| -rw-r--r-- | src/components/emoji-input/suggestor.js | 2 | ||||
| -rw-r--r-- | src/services/api/api.service.js | 16 | ||||
| -rw-r--r-- | src/services/backend_interactor_service/backend_interactor_service.js | 4 | ||||
| -rw-r--r-- | static/gtr.png | bin | 0 -> 4300 bytes | |||
| -rw-r--r-- | static/shpposter_club.jpg | bin | 0 -> 182566 bytes |
5 files changed, 19 insertions, 3 deletions
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 Binary files differnew file mode 100644 index 00000000..70bed92a --- /dev/null +++ b/static/gtr.png diff --git a/static/shpposter_club.jpg b/static/shpposter_club.jpg Binary files differnew file mode 100644 index 00000000..98e817a6 --- /dev/null +++ b/static/shpposter_club.jpg |
