diff options
author | Chocobozzz <me@florianbigard.com> | 2020-06-10 10:58:44 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-06-10 14:02:41 +0200 |
commit | 3521ab8fc01da85fa804439ca6e297e6fb364c58 (patch) | |
tree | 70db4fc628c85d145d59efafbefec9093e9eebac /shared | |
parent | 3b0bd70aa05ab82fa30fe67ed4899d44652c703a (diff) | |
download | PeerTube-3521ab8fc01da85fa804439ca6e297e6fb364c58.tar.gz PeerTube-3521ab8fc01da85fa804439ca6e297e6fb364c58.tar.zst PeerTube-3521ab8fc01da85fa804439ca6e297e6fb364c58.zip |
Add search index tests
Diffstat (limited to 'shared')
-rw-r--r-- | shared/extra-utils/search/video-channels.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/shared/extra-utils/search/video-channels.ts b/shared/extra-utils/search/video-channels.ts index 0532134ae..d16210530 100644 --- a/shared/extra-utils/search/video-channels.ts +++ b/shared/extra-utils/search/video-channels.ts | |||
@@ -1,3 +1,4 @@ | |||
1 | import { VideoChannelsSearchQuery } from '@shared/models' | ||
1 | import { makeGetRequest } from '../requests/requests' | 2 | import { makeGetRequest } from '../requests/requests' |
2 | 3 | ||
3 | function searchVideoChannel (url: string, search: string, token?: string, statusCodeExpected = 200) { | 4 | function searchVideoChannel (url: string, search: string, token?: string, statusCodeExpected = 200) { |
@@ -15,8 +16,20 @@ function searchVideoChannel (url: string, search: string, token?: string, status | |||
15 | }) | 16 | }) |
16 | } | 17 | } |
17 | 18 | ||
19 | function advancedVideoChannelSearch (url: string, search: VideoChannelsSearchQuery) { | ||
20 | const path = '/api/v1/search/video-channels' | ||
21 | |||
22 | return makeGetRequest({ | ||
23 | url, | ||
24 | path, | ||
25 | query: search, | ||
26 | statusCodeExpected: 200 | ||
27 | }) | ||
28 | } | ||
29 | |||
18 | // --------------------------------------------------------------------------- | 30 | // --------------------------------------------------------------------------- |
19 | 31 | ||
20 | export { | 32 | export { |
21 | searchVideoChannel | 33 | searchVideoChannel, |
34 | advancedVideoChannelSearch | ||
22 | } | 35 | } |