Currently, we have multiple commands using the method getSpoSiteId. These methods all have the same functionallty. The code is the following:
private async getSpoSiteId(args: CommandArgs): Promise<string> {
const url = new URL(args.options.webUrl!);
const requestOptions: CliRequestOptions= {
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
headers: {
accept: 'application/json;odata.metadata=none'
},
responseType: 'json'
};
const site = await request.get<{ id: string }>(requestOptions)
return site.id!
}
As this code is reused multiple times, it would be handy if this code is added to a util such as aadGroup.
This method is currently used in the following commands:
- onenote notebook list
- onenote page list (new command, still to be merged)
- spo site apppermission add
- spo site apppermission get
- spo site apppermission list
- spo site apppermission remove
- spo site apppermission set
Currently, we have multiple commands using the method
getSpoSiteId. These methods all have the same functionallty. The code is the following:As this code is reused multiple times, it would be handy if this code is added to a util such as
aadGroup.This method is currently used in the following commands: