Skip to content

Commit 8d0a2e5

Browse files
committed
fix: url change with host for live preview
1 parent 9a30317 commit 8d0a2e5

4 files changed

Lines changed: 13 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
## Change log
2+
### Version: 1.2.0
3+
#### Date: Jan-24-2025
4+
- Fix: URL change for Live Preview
5+
6+
### Version: 1.1.4
7+
#### Date: Jan-17-2025
8+
- Fixed defaultAdapters implementation
9+
- Updated the test cases
10+
211
### Version: 1.1.3
312
#### Date: Oct-22-2024
413
- Fix: getData to receive params and headers both in data

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/core",
3-
"version": "1.1.5",
3+
"version": "1.2.0",
44
"type": "commonjs",
55
"main": "./dist/cjs/src/index.js",
66
"types": "./dist/cjs/src/index.d.ts",

src/lib/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function getData(instance: AxiosInstance, url: string, data?: any)
1919
if (!livePreviewParams.host) {
2020
throw new Error('Host is required for live preview');
2121
}
22-
instance.defaults.baseURL = livePreviewParams.host.startsWith('https://') ? '' : 'https://' + livePreviewParams.host;
22+
url = (livePreviewParams.host.startsWith('https://') ? '' : 'https://') + livePreviewParams.host + url;
2323
}
2424
}
2525
}

0 commit comments

Comments
 (0)