@radio-retail/api-client
Advanced tools
Comparing version 3.4.0 to 3.5.0
const axios = require('axios'); | ||
const qs = require('qs'); | ||
const clients = require('./routes/clients'); | ||
@@ -27,2 +29,6 @@ | ||
const paramSerialiserConfig = { | ||
arrayFormat: 'repeat', | ||
indices: false | ||
}; | ||
const instance = axios.create({ | ||
@@ -35,2 +41,11 @@ baseURL: '/api', | ||
Expires: '0' | ||
}, | ||
paramsSerializer: params => { | ||
const newParams = Object.keys(params).reduce((acc, key) => { | ||
if (params[key] === null) return acc; | ||
return { ...acc, | ||
[key]: params[key] | ||
}; | ||
}, {}); | ||
return qs.stringify(newParams, paramSerialiserConfig); | ||
} | ||
@@ -37,0 +52,0 @@ }); |
{ | ||
"name": "@radio-retail/api-client", | ||
"description": "Radio Retail API client", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"main": "dist/index.js", | ||
@@ -36,3 +36,6 @@ "scripts": { | ||
] | ||
}, | ||
"dependencies": { | ||
"qs": "^6.9.4" | ||
} | ||
} | ||
} |
23853
549
2
+ Addedqs@^6.9.4
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.7(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedqs@6.14.0(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)