aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/logs/logs.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-07 14:32:36 +0100
committerGitHub <noreply@github.com>2020-12-07 14:32:36 +0100
commit2d53be0267acc49cda46707b885096193a1f4e9c (patch)
tree887061a34bc67f40acbb96a6278f9544bf83caeb /shared/extra-utils/logs/logs.ts
parentadc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff)
downloadPeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'shared/extra-utils/logs/logs.ts')
-rw-r--r--shared/extra-utils/logs/logs.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/shared/extra-utils/logs/logs.ts b/shared/extra-utils/logs/logs.ts
index c494c1f1e..8d741276c 100644
--- a/shared/extra-utils/logs/logs.ts
+++ b/shared/extra-utils/logs/logs.ts
@@ -1,5 +1,6 @@
1import { makeGetRequest } from '../requests/requests' 1import { makeGetRequest } from '../requests/requests'
2import { LogLevel } from '../../models/server/log-level.type' 2import { LogLevel } from '../../models/server/log-level.type'
3import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
3 4
4function getLogs (url: string, accessToken: string, startDate: Date, endDate?: Date, level?: LogLevel) { 5function getLogs (url: string, accessToken: string, startDate: Date, endDate?: Date, level?: LogLevel) {
5 const path = '/api/v1/server/logs' 6 const path = '/api/v1/server/logs'
@@ -9,7 +10,7 @@ function getLogs (url: string, accessToken: string, startDate: Date, endDate?: D
9 path, 10 path,
10 token: accessToken, 11 token: accessToken,
11 query: { startDate, endDate, level }, 12 query: { startDate, endDate, level },
12 statusCodeExpected: 200 13 statusCodeExpected: HttpStatusCode.OK_200
13 }) 14 })
14} 15}
15 16
@@ -21,7 +22,7 @@ function getAuditLogs (url: string, accessToken: string, startDate: Date, endDat
21 path, 22 path,
22 token: accessToken, 23 token: accessToken,
23 query: { startDate, endDate }, 24 query: { startDate, endDate },
24 statusCodeExpected: 200 25 statusCodeExpected: HttpStatusCode.OK_200
25 }) 26 })
26} 27}
27 28