From d755e8ffc4d26f9b5b41b8ec14984cbaaa645c98 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Wed, 5 Oct 2022 17:12:10 +0200 Subject: [PATCH] Updated to axios 1.0 --- package-lock.json | 34 +++++++++++++++++++---------- package.json | 2 +- src/api/services/ShlinkApiClient.ts | 3 +-- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6dfaa0c4..4603f33b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@fortawesome/free-regular-svg-icons": "^6.2.0", "@fortawesome/free-solid-svg-icons": "^6.2.0", "@fortawesome/react-fontawesome": "^0.2.0", - "axios": "^0.27.2", + "axios": "^1.0.0", "bootstrap": "^5.1.3", "bottlejs": "^2.0.1", "bowser": "^2.11.0", @@ -7171,12 +7171,13 @@ } }, "node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.0.0.tgz", + "integrity": "sha512-SsHsGFN1qNPFT5QhSoSD37SHDfGyLSW5AESmyLk2JeCMHv5g0I9g0Hz/zQHx2KNe0jGXh2q2hAm7OdkXm360CA==", "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "node_modules/axobject-query": { @@ -19152,6 +19153,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", @@ -32102,12 +32108,13 @@ "dev": true }, "axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.0.0.tgz", + "integrity": "sha512-SsHsGFN1qNPFT5QhSoSD37SHDfGyLSW5AESmyLk2JeCMHv5g0I9g0Hz/zQHx2KNe0jGXh2q2hAm7OdkXm360CA==", "requires": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" } }, "axobject-query": { @@ -41089,6 +41096,11 @@ "ipaddr.js": "1.9.1" } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "psl": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", diff --git a/package.json b/package.json index 05938754..2b55782d 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@fortawesome/free-regular-svg-icons": "^6.2.0", "@fortawesome/free-solid-svg-icons": "^6.2.0", "@fortawesome/react-fontawesome": "^0.2.0", - "axios": "^0.27.2", + "axios": "^1.0.0", "bootstrap": "^5.1.3", "bottlejs": "^2.0.1", "bowser": "^2.11.0", diff --git a/src/api/services/ShlinkApiClient.ts b/src/api/services/ShlinkApiClient.ts index 3e4c1b51..fa0a8745 100644 --- a/src/api/services/ShlinkApiClient.ts +++ b/src/api/services/ShlinkApiClient.ts @@ -18,7 +18,6 @@ import { ShlinkShortUrlsListParams, ShlinkShortUrlsListNormalizedParams, } from '../types'; -import { stringifyQuery } from '../../utils/helpers/query'; import { orderToString } from '../../utils/helpers/ordering'; const buildShlinkBaseUrl = (url: string) => (url ? `${url}/rest/v2` : ''); @@ -123,6 +122,6 @@ export class ShlinkApiClient { headers: { 'X-Api-Key': this.apiKey }, params: rejectNilProps(query), data: body, - paramsSerializer: stringifyQuery, + paramsSerializer: { indexes: false }, }); }