File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,20 +198,27 @@ export abstract class BaseCommand<T extends typeof Command> extends Command {
198198 * @memberof BaseCommand
199199 */
200200 async prepareApiClients ( ) : Promise < void > {
201+ let headers = {
202+ 'X-CS-CLI' : this . context . analyticsInfo
203+ } as any ;
204+
205+ const { uid, organizationUid } = this . sharedConfig . currentConfig ;
206+
207+ if ( uid ) {
208+ headers [ 'x-project-uid' ] = uid ;
209+ }
210+
211+ if ( organizationUid ) {
212+ headers [ 'organization_uid' ] = organizationUid ;
213+ }
214+
201215 this . apolloClient = await new GraphqlApiClient ( {
202- headers : {
203- 'X-CS-CLI' : this . context . analyticsInfo ,
204- 'x-project-uid' : this . sharedConfig . currentConfig . uid ,
205- organization_uid : this . sharedConfig . currentConfig . organizationUid ,
206- } ,
216+ headers,
207217 baseUrl : this . sharedConfig . manageApiBaseUrl ,
208218 } ) . apolloClient ;
219+
209220 this . apolloLogsClient = await new GraphqlApiClient ( {
210- headers : {
211- 'X-CS-CLI' : this . context . analyticsInfo ,
212- 'x-project-uid' : this . sharedConfig . currentConfig . uid ,
213- organization_uid : this . sharedConfig . currentConfig . organizationUid ,
214- } ,
221+ headers,
215222 baseUrl : this . sharedConfig . logsApiBaseUrl ,
216223 } ) . apolloClient ;
217224 }
You can’t perform that action at this time.
0 commit comments