Skip to content

Commit

Permalink
Merge pull request #32 from contentstack/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
nadeem-cs authored Jul 29, 2024
2 parents 2d4e48b + ccc051c commit c8bed98
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Change log

### Version: 4.0.5
#### Date: July-30-2024
Fix: Live preview endpoint issue

### Version: 4.0.5
#### Date: July-23-2024
Dependecy updates
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/delivery-sdk",
"version": "4.0.5",
"version": "4.0.6",
"type": "commonjs",
"main": "./dist/cjs/src/index.js",
"types": "./dist/types/src/index.d.ts",
Expand Down
6 changes: 2 additions & 4 deletions src/lib/contentstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ export function stack(config: StackConfig): StackClass {

if (config.live_preview?.enable === true) {
if (config.live_preview?.management_token != null && config.live_preview?.preview_token == null) {
config.host = 'api.contentstack.io'
config.live_preview.host = config.host
config.host = config.live_preview.host
} else if (config.live_preview?.preview_token != null && config.live_preview?.management_token == null) {
config.host = 'rest-preview.contentstack.com'
config.live_preview.host = config.host
config.host = config.live_preview.host
}
} else {
defaultConfig.defaultHostname = config.host ? config.host : getHost(config.region, config.host);
Expand Down

0 comments on commit c8bed98

Please sign in to comment.