Skip to content

Commit 35c0fcc

Browse files
Merge pull request #472 from contentstack/staging
back merge
2 parents 6f3e76d + 97343d3 commit 35c0fcc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/contentstack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ import { getContentstackEndpoint } from '@contentstack/utils'
172172
*/
173173
export function client (params = {}) {
174174
let defaultHostName = params.region
175-
? getContentstackEndpoint(params.region.toUpperCase(), 'management', true)
175+
? getContentstackEndpoint(params.region.toUpperCase(), 'contentManagement', true)
176176
: getContentstackEndpoint('NA', 'contentManagement', true)
177177

178178
if (params.host) {

test/sanity-check/api/user-test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ describe('Contentstack User Session api Test', () => {
136136
// The new implementation uses getContentstackEndpoint which handles region validation
137137
// It should not throw an error, but will use whatever getContentstackEndpoint returns
138138
try {
139-
const client = contentstack.client({ region: 'DUMMYREGION' })
140-
expect(client).to.not.equal(null, 'Client should be created even with invalid region')
141-
done()
139+
contentstack.client({ region: 'DUMMYREGION' })
140+
done(new Error('Expected an error to be thrown for invalid region'))
142141
} catch (error) {
143-
done(error)
142+
expect(error.message).to.include('Invalid region')
143+
done()
144144
}
145145
})
146146
})

0 commit comments

Comments
 (0)