diff options
author | Chocobozzz <me@florianbigard.com> | 2019-12-11 14:14:01 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-12-11 14:14:01 +0100 |
commit | 566c125d6eee3bd907404523d94e1e0b5e403a46 (patch) | |
tree | c477cdd2ba745015d80052968c37927b1bca1254 /shared/extra-utils | |
parent | 92e0f42e8ce5f1ab5e4023900b8194627231a11b (diff) | |
download | PeerTube-566c125d6eee3bd907404523d94e1e0b5e403a46.tar.gz PeerTube-566c125d6eee3bd907404523d94e1e0b5e403a46.tar.zst PeerTube-566c125d6eee3bd907404523d94e1e0b5e403a46.zip |
Serve audit logs to client
Diffstat (limited to 'shared/extra-utils')
-rw-r--r-- | shared/extra-utils/logs/logs.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/shared/extra-utils/logs/logs.ts b/shared/extra-utils/logs/logs.ts index cbb1afb93..c494c1f1e 100644 --- a/shared/extra-utils/logs/logs.ts +++ b/shared/extra-utils/logs/logs.ts | |||
@@ -13,6 +13,19 @@ function getLogs (url: string, accessToken: string, startDate: Date, endDate?: D | |||
13 | }) | 13 | }) |
14 | } | 14 | } |
15 | 15 | ||
16 | function getAuditLogs (url: string, accessToken: string, startDate: Date, endDate?: Date) { | ||
17 | const path = '/api/v1/server/audit-logs' | ||
18 | |||
19 | return makeGetRequest({ | ||
20 | url, | ||
21 | path, | ||
22 | token: accessToken, | ||
23 | query: { startDate, endDate }, | ||
24 | statusCodeExpected: 200 | ||
25 | }) | ||
26 | } | ||
27 | |||
16 | export { | 28 | export { |
17 | getLogs | 29 | getLogs, |
30 | getAuditLogs | ||
18 | } | 31 | } |