]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/logs/logs.ts
Serve audit logs to client
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / logs / logs.ts
index cbb1afb930ab46d614728908d15908941bd91759..c494c1f1eb785767fcdb0b974e51361ee6b83dbf 100644 (file)
@@ -13,6 +13,19 @@ function getLogs (url: string, accessToken: string, startDate: Date, endDate?: D
   })
 }
 
+function getAuditLogs (url: string, accessToken: string, startDate: Date, endDate?: Date) {
+  const path = '/api/v1/server/audit-logs'
+
+  return makeGetRequest({
+    url,
+    path,
+    token: accessToken,
+    query: { startDate, endDate },
+    statusCodeExpected: 200
+  })
+}
+
 export {
-  getLogs
+  getLogs,
+  getAuditLogs
 }