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>
26 lines
863 B
JavaScript
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 };
|