From 74a4d53110ebc073dafeb74a7ac815fe00f4706b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 24 Mar 2021 09:16:48 +0100 Subject: Add server hooks for search endpoint --- server/tests/fixtures/peertube-plugin-test/main.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'server/tests/fixtures/peertube-plugin-test') diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js index dfcc874d4..ee0bc39f3 100644 --- a/server/tests/fixtures/peertube-plugin-test/main.js +++ b/server/tests/fixtures/peertube-plugin-test/main.js @@ -230,6 +230,30 @@ async function register ({ registerHook, registerSetting, settingsManager, stora } } }) + + { + const searchHooks = [ + 'filter:api.search.videos.local.list.params', + 'filter:api.search.videos.local.list.result', + 'filter:api.search.videos.index.list.params', + 'filter:api.search.videos.index.list.result', + 'filter:api.search.video-channels.local.list.params', + 'filter:api.search.video-channels.local.list.result', + 'filter:api.search.video-channels.index.list.params', + 'filter:api.search.video-channels.index.list.result', + ] + + for (const h of searchHooks) { + registerHook({ + target: h, + handler: (obj) => { + peertubeHelpers.logger.debug('Run hook %s.', h) + + return obj + } + }) + } + } } async function unregister () { -- cgit v1.2.3