aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/utils/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-09 11:21:36 +0200
committerChocobozzz <me@florianbigard.com>2019-04-09 11:24:15 +0200
commit22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b (patch)
treead8668b1480997f5e48cd5188630265aa21dfeba /shared/utils/users
parentc100a6142e6571312db9f6407698a21a08b593fb (diff)
downloadPeerTube-22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b.tar.gz
PeerTube-22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b.tar.zst
PeerTube-22834691abb6e74d31654ffd2ebeaaaa8ef3ac7b.zip
Add check params account ratings tests
Diffstat (limited to 'shared/utils/users')
-rw-r--r--shared/utils/users/accounts.ts5
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'
7import { Account } from '../../models/actors' 7import { Account } from '../../models/actors'
8import { root } from '../miscs/miscs' 8import { root } from '../miscs/miscs'
9import { makeGetRequest } from '../requests/requests' 9import { makeGetRequest } from '../requests/requests'
10import { VideoRateType } from '../../models/videos'
10 11
11function getAccountsList (url: string, sort = '-createdAt', statusCodeExpected = 200) { 12function 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
57function getAccountRatings (url: string, accountName: string, accessToken: string, statusCodeExpected = 200, query = {}) { 58function 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)