Skip to content

Commit 4722339

Browse files
committed
Grab just changed service keys
1 parent a573b2c commit 4722339

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

apps/meteor/server/lib/auditServerEvents/userChanged.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,18 @@ export class UserChangedAuditStore {
8282
}
8383

8484
if (key === 'services') {
85+
const changedServices = Object.keys(updateFilter.$set?.[key] || {}).map((serviceKey) => [
86+
serviceKey,
87+
value[serviceKey as keyof typeof value],
88+
]);
89+
90+
if (!changedServices.length) {
91+
return acc;
92+
}
93+
8594
return {
8695
...acc,
87-
[key]: obfuscateServices(value as Record<string, any>),
96+
[key]: obfuscateServices(Object.fromEntries(changedServices) as Record<string, any>),
8897
};
8998
}
9099

0 commit comments

Comments
 (0)