From: Chocobozzz Date: Mon, 11 Oct 2021 12:12:45 +0000 (+0200) Subject: Fix channel handle search X-Git-Tag: v4.0.0-rc.1~300 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=ab632f438efed53e3ed4ba08dd73cc666366af2b;p=github%2FChocobozzz%2FPeerTube.git Fix channel handle search --- diff --git a/server/controllers/api/search/search-video-channels.ts b/server/controllers/api/search/search-video-channels.ts index 25173ac20..089feed65 100644 --- a/server/controllers/api/search/search-video-channels.ts +++ b/server/controllers/api/search/search-video-channels.ts @@ -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)