aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/utils/users
diff options
context:
space:
mode:
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)