Skip to content

Commit

Permalink
fix: url change with host for live preview
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeem-cs committed Jan 23, 2025
1 parent 9a30317 commit 8d0a2e5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
## Change log
### Version: 1.2.0
#### Date: Jan-24-2025
- Fix: URL change for Live Preview

### Version: 1.1.4
#### Date: Jan-17-2025
- Fixed defaultAdapters implementation
- Updated the test cases

### Version: 1.1.3
#### Date: Oct-22-2024
- Fix: getData to receive params and headers both in data
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/core",
"version": "1.1.5",
"version": "1.2.0",
"type": "commonjs",
"main": "./dist/cjs/src/index.js",
"types": "./dist/cjs/src/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function getData(instance: AxiosInstance, url: string, data?: any)
if (!livePreviewParams.host) {
throw new Error('Host is required for live preview');
}
instance.defaults.baseURL = livePreviewParams.host.startsWith('https://') ? '' : 'https://' + livePreviewParams.host;
url = (livePreviewParams.host.startsWith('https://') ? '' : 'https://') + livePreviewParams.host + url;
}
}
}
Expand Down

0 comments on commit 8d0a2e5

Please sign in to comment.