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
@@ -74,7 +74,7 @@ export async function createUtilizationCategory(
entityId: created.id,
entityName: created.name,
action: "CREATE",
userId: ctx.dbUser?.id,
...(ctx.dbUser?.id ? { userId: ctx.dbUser.id } : {}),
after: created as unknown as Record<string, unknown>,
source: "ui",
});
@@ -112,7 +112,7 @@ export async function updateUtilizationCategory(
entityId: updated.id,
entityName: updated.name,
action: "UPDATE",
userId: ctx.dbUser?.id,
...(ctx.dbUser?.id ? { userId: ctx.dbUser.id } : {}),
before,
after: updated as unknown as Record<string, unknown>,
source: "ui",