Skip to content

Commit

Permalink
updates based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
reshmee011 committed Jan 20, 2025
1 parent de55555 commit 69fb83b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/docs/cmd/spo/tenant/tenant-homesite-add.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ m365 spo tenant homesite add [options]
: Specifies whether the home site is the default start for Viva Connections. Accepts `true` or `false`.

`--audiences [audiences]`
: Comma-separated list of audience GUIDs.
: Comma-separated list of audience GUIDs which are GUIDs of Microsoft Entra groups.

`--order [order]`
: Order of the home site. Must be an integer.
Expand Down
22 changes: 11 additions & 11 deletions src/m365/spo/commands/tenant/tenant-homesite-add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ interface CommandArgs {

interface Options extends GlobalOptions {
url: string;
audiences: string,
vivaConnectionsDefaultStart: boolean,
isInDraftMode: boolean,
order: number
}

class SpoTenantHomeSiteAddCommand extends SpoCommand {
Expand Down Expand Up @@ -70,16 +74,12 @@ class SpoTenantHomeSiteAddCommand extends SpoCommand {
}

if (args.options.audiences) {
const invalidGuid = args.options.audiences.split(',').find((guid: string | undefined) => !validation.isValidGuid(guid));
if (invalidGuid) {
return `${invalidGuid} is not a valid GUID`;
const validGuid = validation.isValidGuidArray(args.options.audiences);
if (!validGuid) {
return `${args.options.audiences} has an invalid GUID`;
}
}

if (args.options.order !== undefined && isNaN(parseInt(args.options.order))) {
return 'Order must be an integer';
}

return true;
}
);
Expand All @@ -96,10 +96,10 @@ class SpoTenantHomeSiteAddCommand extends SpoCommand {
responseType: 'json',
data: {
siteUrl: args.options.url,
audiences = args.options.audiences?split(','),
vivaConnectionsDefaultStart = args.options.vivaConnectionsDefaultStart ?? true,
isInDraftMode = args.options.isInDraftMode ?? true,
order = args.options.order
audiences: args.options.audiences?.split(','),
vivaConnectionsDefaultStart: args.options.vivaConnectionsDefaultStart ?? true,
isInDraftMode: args.options.isInDraftMode ?? true,
order: args.options.order
}
};

Expand Down

0 comments on commit 69fb83b

Please sign in to comment.