diff --git a/packages/client/src/classes/client.js b/packages/client/src/classes/client.js index ca3298009..21dfe449f 100644 --- a/packages/client/src/classes/client.js +++ b/packages/client/src/classes/client.js @@ -106,6 +106,7 @@ class Client { this.setDefaultRequest('baseUrl', REGION_HOST_MAP[region]); console.log('Set region as given.'); } + return this; } createHeaders(data) { diff --git a/packages/client/src/client.d.ts b/packages/client/src/client.d.ts index 74f125fd5..84075d1f9 100644 --- a/packages/client/src/client.d.ts +++ b/packages/client/src/client.d.ts @@ -33,7 +33,7 @@ declare class Client { /** * Sets the data residency as per region provided */ - setDataResidency(region: string): void; + setDataResidency(region: string): this; /** * Create headers for request diff --git a/packages/client/src/client.spec.js b/packages/client/src/client.spec.js index 4865d599f..57cbcdf23 100644 --- a/packages/client/src/client.spec.js +++ b/packages/client/src/client.spec.js @@ -3100,6 +3100,7 @@ describe('test client', () => { describe('setDataResidency', () => { testClient.setDataResidency('eu'); + sgClient.setDataResidency('eu'); console.log('Actual:', testClient.defaultRequest.baseUrl); it('should have hostname as global', () => { console.log(testClient);