Fix channel handle search

This commit is contained in:
Chocobozzz 2021-10-11 14:12:45 +02:00
parent 8bd67ef6af
commit ab632f438e
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ export { searchChannelsRouter }
function searchVideoChannels (req: express.Request, res: express.Response) {
const query = pickSearchChannelQuery(req.query)
let search = query.search || ''
const search = query.search || ''
const parts = search.split('@')
@ -58,7 +58,7 @@ function searchVideoChannels (req: express.Request, res: express.Response) {
if (isURISearch(search) || isWebfingerSearch) return searchVideoChannelURI(search, isWebfingerSearch, res)
// @username -> username to search in DB
if (search.startsWith('@')) search = search.replace(/^@/, '')
if (search.startsWith('@')) query.search = search.replace(/^@/, '')
if (isSearchIndexSearch(query)) {
return searchVideoChannelsIndex(query, res)