Avoid passing undefined to values that are marked as optional
This commit is contained in:
@@ -158,21 +158,27 @@ export async function readMicrosoftGraphGroups(
|
||||
kind: 'Group',
|
||||
metadata: {
|
||||
name: name,
|
||||
description: group.description ?? undefined,
|
||||
annotations: {
|
||||
[MICROSOFT_GRAPH_GROUP_ID_ANNOTATION]: group.id,
|
||||
},
|
||||
},
|
||||
spec: {
|
||||
type: 'team',
|
||||
profile: {
|
||||
displayName: group.displayName,
|
||||
email: group.mail ?? undefined,
|
||||
},
|
||||
profile: {},
|
||||
children: [],
|
||||
},
|
||||
};
|
||||
|
||||
if (group.description) {
|
||||
entity.metadata.description = group.description;
|
||||
}
|
||||
if (group.displayName) {
|
||||
entity.spec.profile!.displayName = group.displayName;
|
||||
}
|
||||
if (group.mail) {
|
||||
entity.spec.profile!.email = group.mail;
|
||||
}
|
||||
|
||||
// Download the members in parallel, otherwise it can take quite some time
|
||||
const loadGroupMembers = limiter(async () => {
|
||||
for await (const member of client.getGroupMembers(group.id!)) {
|
||||
|
||||
Reference in New Issue
Block a user