diff --git a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts index 457a83c703..db749a536e 100644 --- a/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts +++ b/plugins/catalog-backend-module-msgraph/src/microsoftGraph/client.ts @@ -106,12 +106,13 @@ export class MicrosoftGraphClient { path: string, query?: ODataQuery, ): AsyncIterable { - - const headers: Record = query?.search ? { - // Eventual consistency is required to use $search. - // If a new user/group is not found, it'll eventually be imported on a subsequent read - ConsistencyLevel: 'eventual', - } : {} + const headers: Record = query?.search + ? { + // Eventual consistency is required to use $search. + // If a new user/group is not found, it'll eventually be imported on a subsequent read + ConsistencyLevel: 'eventual', + } + : {}; let response = await this.requestApi(path, query, headers); @@ -144,7 +145,11 @@ export class MicrosoftGraphClient { * @param query - OData Query {@link ODataQuery} * @param headers - optional HTTP headers */ - async requestApi(path: string, query?: ODataQuery, headers?: Record): Promise { + async requestApi( + path: string, + query?: ODataQuery, + headers?: Record, + ): Promise { const queryString = qs.stringify( { $search: query?.search, @@ -159,7 +164,10 @@ export class MicrosoftGraphClient { }, ); - return await this.requestRaw(`${this.baseUrl}/${path}${queryString}`, headers); + return await this.requestRaw( + `${this.baseUrl}/${path}${queryString}`, + headers, + ); } /** @@ -168,7 +176,10 @@ export class MicrosoftGraphClient { * @param url - HTTP Endpoint of Graph API * @param headers - optional HTTP headers */ - async requestRaw(url: string, headers?: Record): Promise { + async requestRaw( + url: string, + headers?: Record, + ): Promise { // Make sure that we always have a valid access token (might be cached) const token = await this.pca.acquireTokenByClientCredential({ scopes: ['https://graph.microsoft.com/.default'],