Merge pull request #774 from StCyr/bugfix/773/search_with_#

FIX: Removes heading '#' from the search terms as search won't work
pull/779/head
Maxence Lange 2019-10-02 15:11:46 -01:00 zatwierdzone przez GitHub
commit c0d71b7e09
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -132,6 +132,10 @@ class SearchService {
return $result;
}
if (substr($search, 0, 1) === '#') {
$search = substr($search, 1);
}
try {
$exact = $this->hashtagService->getHashtag($search);
$result['exact'] = $exact;
@ -161,6 +165,7 @@ class SearchService {
return $result;
}
// TODO : search using FullTextSearch ?
return $result;
}

Wyświetl plik

@ -225,6 +225,7 @@ export default {
})
},
search(term) {
term = encodeURIComponent(term)
this.searchTerm = term
},
resetSearch() {

Wyświetl plik

@ -28,11 +28,11 @@
{{ t('social', 'No results found') }}
</h2>
<p v-if="!loading">
{{ t('social', 'There were no results for your search:') }} {{ term }}
{{ t('social', 'There were no results for your search:') }} {{ decodeURIComponent(term) }}
</p>
</div>
<div v-else>
<h3>{{ t('social', 'Searching for') }} {{ term }}</h3>
<h3>{{ t('social', 'Searching for') }} {{ decodeURIComponent(term) }}</h3>
<user-entry v-for="result in allResults" :key="result.id" :item="result" />
<div v-if="hashtags.length > 0">
<li v-for="tag in hashtags" :key="tag.hashtag" class="tag">