Skip to content

Commit

Permalink
fix(app-audit-logs): check for group name before using it (#3665)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunozoric authored and adrians5j committed Nov 8, 2023
1 parent 5746389 commit cc35e2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions packages/app-audit-logs/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type AuditLog = {
export interface AuditLog {
id: string;
message: string;
app: string;
Expand All @@ -8,13 +8,13 @@ export type AuditLog = {
data: string;
timestamp: Date;
initiator: string;
};
}

export type User = {
export interface User {
id: string;
firstName: string;
lastName: string;
group: {
group?: {
name: string;
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const transformCmsContentEntriesToRecordEntries = (
initiator: {
id: data.initiator,
name: `${user?.firstName} ${user?.lastName}`,
role: user?.group.name || ""
role: user?.group?.name || ""
}
};
});
Expand Down

0 comments on commit cc35e2c

Please sign in to comment.