fix(api): harden optional audit and session fields

This commit is contained in:
2026-03-31 22:54:33 +02:00
parent 160ba99b5c
commit 8bc764a35e
4 changed files with 47 additions and 4 deletions
@@ -40,7 +40,7 @@ export async function updateSystemRoleConfig(
entityId: input.role,
entityName: result.label,
action: "UPDATE",
userId: ctx.dbUser?.id,
...(ctx.dbUser?.id ? { userId: ctx.dbUser.id } : {}),
before: (existing ?? {}) as unknown as Record<string, unknown>,
after: result as unknown as Record<string, unknown>,
source: "ui",