Skip to content

Commit f23f936

Browse files
committed
temp commit
1 parent a4434d5 commit f23f936

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/m365/spo/commands/site/site-set.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ class SpoSiteSetCommand extends SpoCommand {
700700

701701
const camlQuery = `<Query><Where><Contains><FieldRef Name='SiteUrl'/><Value Type='Text'>${siteUrl}</Value></Contains></Where></Query>`;
702702
const viewFields = ['GroupId', 'SiteId', 'SiteUrl'];
703-
const result: TenantSites = await spo.getTenantSites(this.spoAdminUrl, camlQuery, viewFields);
703+
const result: TenantSites = await spo.getTenantSites(this.spoAdminUrl, camlQuery, viewFields, logger, true);
704704
this.groupId = result.Row[0].GroupId.replace(/{*}*/gi, "");
705705
this.siteId = result.Row[0].SiteId.replace(/{*}*/gi, "");
706706
}

src/utils/spo.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ describe('utils/spo', () => {
10051005
throw 'Invalid request';
10061006
});
10071007

1008-
const customAction = await spo.getTenantSites('https://contoso-admin.sharepoint.com', `<Query><Where><Contains><FieldRef Name='SiteUrl'/><Value Type='Text'>https://contoso.sharepoint.com/sites/site-x</Value></Contains></Where></Query>`, ['GroupId', 'SiteId', 'SiteUrl']);
1008+
const customAction = await spo.getTenantSites('https://contoso-admin.sharepoint.com', `<Query><Where><Contains><FieldRef Name='SiteUrl'/><Value Type='Text'>https://contoso.sharepoint.com/sites/site-x</Value></Contains></Where></Query>`, ['GroupId', 'SiteId', 'SiteUrl'], logger, true);
10091009
assert.deepEqual(customAction, tenantSitesResponse);
10101010
});
10111011

src/utils/spo.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,11 +847,16 @@ export const spo = {
847847

848848
/**
849849
* Retrieves the tenant sites
850+
* Returns a TenantSites object
850851
* @param adminUrl URL of the SharePoint admin site
851852
* @param camlQuery An optional viewQuery to add to the CAML query between the <Query> tags.
852853
* @param viewFields An optional array of internal names of fields to include in the response.
853854
*/
854-
getTenantSites(adminUrl: string | undefined, camlQuery?: string, viewFields?: string[]): Promise<TenantSites> {
855+
getTenantSites(adminUrl: string | undefined, camlQuery?: string, viewFields?: string[], logger?: Logger, verbose?: boolean): Promise<TenantSites> {
856+
if (verbose && logger) {
857+
logger.logToStderr(`Retrieving the tenant sites for ${adminUrl}`);
858+
}
859+
855860
const viewFieldsString: string | undefined = viewFields?.map(v => `<FieldRef Name="${v}"/>`).join('');
856861

857862
const requestOptions: any = {

0 commit comments

Comments
 (0)