fix(api): harden optional audit and session fields
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user