summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-05-09 12:00:08 -0400
committerCorey Hulen <corey@hulen.com>2016-05-09 09:00:08 -0700
commit07126101d379b900724c7c5cfc82070b42c235d6 (patch)
tree80b2485b61eb1684cd6127473267af206c3ab1c2 /webapp
parent9e07f4b021b28a3e301359a48cf950298f3e552e (diff)
downloadchat-07126101d379b900724c7c5cfc82070b42c235d6.tar.gz
chat-07126101d379b900724c7c5cfc82070b42c235d6.tar.bz2
chat-07126101d379b900724c7c5cfc82070b42c235d6.zip
Recent mention searches now OR terms instead of AND (#2931)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/client/client.jsx10
-rw-r--r--webapp/components/search_bar.jsx1
-rw-r--r--webapp/tests/client_post.test.jsx1
-rw-r--r--webapp/utils/async_client.jsx5
4 files changed, 12 insertions, 5 deletions
diff --git a/webapp/client/client.jsx b/webapp/client/client.jsx
index 9bcbeed4e..5d0dd07c9 100644
--- a/webapp/client/client.jsx
+++ b/webapp/client/client.jsx
@@ -1267,13 +1267,17 @@ export default class Client {
this.track('api', 'api_posts_delete');
}
- search = (terms, success, error) => {
+ search = (terms, isOrSearch, success, error) => {
+ const data = {};
+ data.terms = terms;
+ data.is_or_search = isOrSearch;
+
request.
- get(`${this.getTeamNeededRoute()}/posts/search`).
+ post(`${this.getTeamNeededRoute()}/posts/search`).
set(this.defaultHeaders).
type('application/json').
accept('application/json').
- query({terms}).
+ send(data).
end(this.handleResponse.bind(this, 'search', success, error));
this.track('api', 'api_posts_search');
diff --git a/webapp/components/search_bar.jsx b/webapp/components/search_bar.jsx
index 1156ac0f1..6ebb9cfdc 100644
--- a/webapp/components/search_bar.jsx
+++ b/webapp/components/search_bar.jsx
@@ -114,6 +114,7 @@ class SearchBar extends React.Component {
client.search(
terms,
+ isMentionSearch,
(data) => {
this.setState({isSearching: false});
if (utils.isMobile()) {
diff --git a/webapp/tests/client_post.test.jsx b/webapp/tests/client_post.test.jsx
index db48e4000..c8e6fad0f 100644
--- a/webapp/tests/client_post.test.jsx
+++ b/webapp/tests/client_post.test.jsx
@@ -102,6 +102,7 @@ describe('Client.Posts', function() {
TestHelper.initBasic(() => {
TestHelper.basicClient().search(
'unit test',
+ false,
function(data) {
assert.equal(data.order[0], TestHelper.basicPost().id);
done();
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index 1dcead326..a562964b1 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -467,7 +467,7 @@ export function getAllTeamListings() {
);
}
-export function search(terms) {
+export function search(terms, isOrSearch) {
if (isCallInProgress('search_' + String(terms))) {
return;
}
@@ -475,6 +475,7 @@ export function search(terms) {
callTracker['search_' + String(terms)] = utils.getTimestamp();
Client.search(
terms,
+ isOrSearch,
(data) => {
callTracker['search_' + String(terms)] = 0;
@@ -1370,4 +1371,4 @@ export function getPublicLink(filename, success, error) {
}
}
);
-} \ No newline at end of file
+}