Skip to content

Commit

Permalink
fix axios@1 paramsSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
shrpne committed Aug 13, 2023
1 parent c68c0d4 commit 3e07fea
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.46.2 - 2023.08.13
- fix axios@1 paramsSerializer

## 0.46.1 - 2023.06.02
- `getPoolInfo` now accepts coin symbols as params

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": "minter-js-sdk",
"version": "0.46.1",
"version": "0.46.2",
"description": "JS SDK for Minter Blockchain",
"main": "dist/cjs/index.js",
"module": "src/index.js",
Expand Down
6 changes: 5 additions & 1 deletion src/api/estimate-coin-buy.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ export default function EstimateCoinBuy(apiInstance, factoryAxiosOptions) {
...factoryAxiosOptions,
...axiosOptions,
params,
paramsSerializer: (query) => qsStringify(query, {arrayFormat: 'repeat'}),
// @see https://github.com/axios/axios/issues/5058#issuecomment-1272107602
paramsSerializer: {
// eslint-disable-next-line unicorn/no-null
indexes: null,
},
})
.then((response) => {
const resData = response.data;
Expand Down
6 changes: 5 additions & 1 deletion src/api/estimate-coin-sell-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ export default function EstimateCoinSellAll(apiInstance, factoryAxiosOptions) {
...factoryAxiosOptions,
...axiosOptions,
params,
paramsSerializer: (query) => qsStringify(query, {arrayFormat: 'repeat'}),
// @see https://github.com/axios/axios/issues/5058#issuecomment-1272107602
paramsSerializer: {
// eslint-disable-next-line unicorn/no-null
indexes: null,
},
})
.then((response) => {
const resData = response.data;
Expand Down
6 changes: 5 additions & 1 deletion src/api/estimate-coin-sell.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ export default function EstimateCoinSell(apiInstance, factoryAxiosOptions) {
...factoryAxiosOptions,
...axiosOptions,
params,
paramsSerializer: (query) => qsStringify(query, {arrayFormat: 'repeat'}),
// @see https://github.com/axios/axios/issues/5058#issuecomment-1272107602
paramsSerializer: {
// eslint-disable-next-line unicorn/no-null
indexes: null,
},
})
.then((response) => {
const resData = response.data;
Expand Down

0 comments on commit 3e07fea

Please sign in to comment.