PLT-4403 Add server-based channel autocomplete, search and paging (#4585)
* Add more channel paging API * Add channel paging support to client * Add DB channel search functions * Add API for searching more channels * Add more channel search functionality to client * Add API for autocompleting channels * Add channel autocomplete functionality to the client * Move to be deprecated APIs to their own file * Final clean-up * Fixes related to feedback * Localization changes * Add unit as suffix to timeout constants
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
c96ecae6da
Коммит
981ea33b8e
@@ -1362,6 +1362,7 @@ export default class Client {
|
||||
this.track('api', 'api_channel_get');
|
||||
}
|
||||
|
||||
// SCHEDULED FOR DEPRECATION IN 3.7 - use getMoreChannelsPage instead
|
||||
getMoreChannels(success, error) {
|
||||
request.
|
||||
get(`${this.getChannelsRoute()}/more`).
|
||||
@@ -1371,6 +1372,34 @@ export default class Client {
|
||||
end(this.handleResponse.bind(this, 'getMoreChannels', success, error));
|
||||
}
|
||||
|
||||
getMoreChannelsPage(offset, limit, success, error) {
|
||||
request.
|
||||
get(`${this.getChannelsRoute()}/more/${offset}/${limit}`).
|
||||
set(this.defaultHeaders).
|
||||
type('application/json').
|
||||
accept('application/json').
|
||||
end(this.handleResponse.bind(this, 'getMoreChannelsPage', success, error));
|
||||
}
|
||||
|
||||
searchMoreChannels(term, success, error) {
|
||||
request.
|
||||
post(`${this.getChannelsRoute()}/more/search`).
|
||||
set(this.defaultHeaders).
|
||||
type('application/json').
|
||||
accept('application/json').
|
||||
send({term}).
|
||||
end(this.handleResponse.bind(this, 'searchMoreChannels', success, error));
|
||||
}
|
||||
|
||||
autocompleteChannels(term, success, error) {
|
||||
request.
|
||||
get(`${this.getChannelsRoute()}/autocomplete?term=${encodeURIComponent(term)}`).
|
||||
set(this.defaultHeaders).
|
||||
type('application/json').
|
||||
accept('application/json').
|
||||
end(this.handleResponse.bind(this, 'autocompleteChannels', success, error));
|
||||
}
|
||||
|
||||
getChannelCounts(success, error) {
|
||||
request.
|
||||
get(`${this.getChannelsRoute()}/counts`).
|
||||
|
||||
Ссылка в новой задаче
Block a user