Skip to content

Fix: getData to receive params and headers both in data #62

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## Change log
### Version: 1.1.3
#### Date: Oct-22-2024
- Fix: getData to receive params and headers both in data

## Change log
### Version: 1.1.2
#### Date: Oct-22-2024
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/core",
"version": "1.1.2",
"version": "1.1.3",
"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 @@ -23,7 +23,7 @@ export async function getData(instance: AxiosInstance, url: string, data?: any)
}
}
}
const response = await instance.get(url, { params: data });
const response = await instance.get(url, data);

if (response && response.data) {
return response.data;
Expand Down
3 changes: 2 additions & 1 deletion src/lib/retryPolicy/delivery-sdk-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export const retryResponseErrorHandler = (error: any, config: any, axiosInstance
if (error.response && error.response.data) {
return Promise.reject(error.response.data);
}

return Promise.reject(error);
}
error.config.retryCount = retryCount;
error.config.retryCount = retryCount;

return axiosInstance(error.config);
}
Expand Down
Loading