kopia lustrzana https://github.com/nextcloud/social
				
				
				
			Merge pull request #774 from StCyr/bugfix/773/search_with_#
FIX: Removes heading '#' from the search terms as search won't workpull/779/head
						commit
						c0d71b7e09
					
				|  | @ -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; | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
|  | @ -225,6 +225,7 @@ export default { | |||
| 			}) | ||||
| 		}, | ||||
| 		search(term) { | ||||
| 			term = encodeURIComponent(term) | ||||
| 			this.searchTerm = term | ||||
| 		}, | ||||
| 		resetSearch() { | ||||
|  |  | |||
|  | @ -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"> | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Maxence Lange
						Maxence Lange