aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-21 16:13:20 +0200
committerChocobozzz <me@florianbigard.com>2021-07-21 16:13:20 +0200
commitd1aed103539e2e53418a44716f8f2b1603cd339f (patch)
treea4b43d0f852f362eead0224fa9d992a908c04478 /server/controllers
parent64f9b91de99eb04cad12ec7370eddc30f6fda1e5 (diff)
downloadPeerTube-d1aed103539e2e53418a44716f8f2b1603cd339f.tar.gz
PeerTube-d1aed103539e2e53418a44716f8f2b1603cd339f.tar.zst
PeerTube-d1aed103539e2e53418a44716f8f2b1603cd339f.zip
Add overviews filter hook tests
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/overviews.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/controllers/api/overviews.ts b/server/controllers/api/overviews.ts
index 727ed66d7..2dfac15ef 100644
--- a/server/controllers/api/overviews.ts
+++ b/server/controllers/api/overviews.ts
@@ -109,7 +109,7 @@ async function getVideos (
109 res: express.Response, 109 res: express.Response,
110 where: { videoChannelId?: number, tagsOneOf?: string[], categoryOneOf?: number[] } 110 where: { videoChannelId?: number, tagsOneOf?: string[], categoryOneOf?: number[] }
111) { 111) {
112 let query = Object.assign({ 112 const query = await Hooks.wrapObject({
113 start: 0, 113 start: 0,
114 count: 12, 114 count: 12,
115 sort: '-createdAt', 115 sort: '-createdAt',
@@ -117,10 +117,10 @@ async function getVideos (
117 nsfw: buildNSFWFilter(res), 117 nsfw: buildNSFWFilter(res),
118 user: res.locals.oauth ? res.locals.oauth.token.User : undefined, 118 user: res.locals.oauth ? res.locals.oauth.token.User : undefined,
119 withFiles: false, 119 withFiles: false,
120 countVideos: false 120 countVideos: false,
121 }, where)
122 121
123 query = await Hooks.wrapObject(query, 'filter:api.overviews.videos.list.params') 122 ...where
123 }, 'filter:api.overviews.videos.list.params')
124 124
125 const { data } = await Hooks.wrapPromiseFun( 125 const { data } = await Hooks.wrapPromiseFun(
126 VideoModel.listForApi, 126 VideoModel.listForApi,