diff options
author | Chocobozzz <me@florianbigard.com> | 2019-04-09 11:21:36 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-04-09 11:24:15 +0200 |
commit | 22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b (patch) | |
tree | ad8668b1480997f5e48cd5188630265aa21dfeba /shared/utils/users/accounts.ts | |
parent | c100a6142e6571312db9f6407698a21a08b593fb (diff) | |
download | PeerTube-22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b.tar.gz PeerTube-22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b.tar.zst PeerTube-22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b.zip |
Add check params account ratings tests
Diffstat (limited to 'shared/utils/users/accounts.ts')
-rw-r--r-- | shared/utils/users/accounts.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shared/utils/users/accounts.ts b/shared/utils/users/accounts.ts index 54d66ac2a..f64a2dbad 100644 --- a/shared/utils/users/accounts.ts +++ b/shared/utils/users/accounts.ts | |||
@@ -7,6 +7,7 @@ import { join } from 'path' | |||
7 | import { Account } from '../../models/actors' | 7 | import { Account } from '../../models/actors' |
8 | import { root } from '../miscs/miscs' | 8 | import { root } from '../miscs/miscs' |
9 | import { makeGetRequest } from '../requests/requests' | 9 | import { makeGetRequest } from '../requests/requests' |
10 | import { VideoRateType } from '../../models/videos' | ||
10 | 11 | ||
11 | function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) { | 12 | function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) { |
12 | const path = '/api/v1/accounts' | 13 | const path = '/api/v1/accounts' |
@@ -54,9 +55,11 @@ async function checkActorFilesWereRemoved (actorUUID: string, serverNumber: numb | |||
54 | } | 55 | } |
55 | } | 56 | } |
56 | 57 | ||
57 | function getAccountRatings (url: string, accountName: string, accessToken: string, statusCodeExpected = 200, query = {}) { | 58 | function getAccountRatings (url: string, accountName: string, accessToken: string, rating?: VideoRateType, statusCodeExpected = 200) { |
58 | const path = '/api/v1/accounts/' + accountName + '/ratings' | 59 | const path = '/api/v1/accounts/' + accountName + '/ratings' |
59 | 60 | ||
61 | const query = rating ? { rating } : {} | ||
62 | |||
60 | return request(url) | 63 | return request(url) |
61 | .get(path) | 64 | .get(path) |
62 | .query(query) | 65 | .query(query) |