Files
omsorg/omsorgapp/electron/backend/auditLogClient.cjs
T
Felix KemmlerandClaude Sonnet 5 e9e96a57dc Add facilities, contracts, orders, value lists, audit log, and desktop app modules
Extends omsorgCore with full CRUD for Facility/Contract/Order plus
configurable value lists and an audit trail, and wires the omsorgapp
frontend up to the new facilities, settings, and audit-log modules;
includes a sidebar active-nav-item highlight.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-08 23:29:16 +02:00

26 lines
863 B
JavaScript

const { AuditLogApi } = require('omsorgcore-client-ts');
const { configFor, callApi } = require('./apiClientHelpers.cjs');
// Kapselt GET /api/audit-log (AuditLogController) über den generierten Client
// (omsorgcore-client-ts) - rein lesend, keine weiteren Verben.
async function listAuditLog(
accessToken,
{ page = 1, pageSize = 50, entityType, entityId, actorUserId, category, fromUtc, toUtc } = {}
) {
const api = new AuditLogApi(configFor(accessToken));
return callApi(
api.apiAuditLogGetRaw({
page,
pageSize,
entityType: entityType || undefined,
entityId: entityId || undefined,
actorUserId: actorUserId || undefined,
category: category || undefined,
fromUtc: fromUtc ? new Date(fromUtc) : undefined,
toUtc: toUtc ? new Date(toUtc) : undefined,
})
);
}
module.exports = { listAuditLog };