@dewib/dw-api
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [2.0.1](https://github.com/gaetansenn/dw-api/compare/v2.0.0...v2.0.1) (2021-10-05) | ||
### Bug Fixes | ||
* avoid Content-Length for request withtout body (GET) ([bad6fd8](https://github.com/gaetansenn/dw-api/commit/bad6fd850279a8e278eaadd0b85b461401dc8762)) | ||
## [2.0.0](https://github.com/gaetansenn/dw-api/compare/v1.1.0...v2.0.0) (2021-09-02) | ||
@@ -7,0 +14,0 @@ |
@@ -76,10 +76,13 @@ import { isObject, camelCase, isEmpty, isString, get } from 'lodash' | ||
handleRequest ({ method, url, body = {}, fields = [], multi = false, queryParams = {}, headers = {}, catchError = true, scope }) { | ||
return this.$axios({ | ||
handleRequest ({ method, url, body = false, fields = [], multi = false, queryParams = {}, headers = {}, catchError = true, scope }) { | ||
const request = { | ||
method, | ||
url, | ||
headers, | ||
params: queryParams, | ||
data: body | ||
}).then((response) => { | ||
params: queryParams | ||
} | ||
if (body) request.data = body | ||
return this.$axios(request).then((response) => { | ||
// Inject scope | ||
@@ -86,0 +89,0 @@ response.data = scope ? get(response.data, scope) : response.data |
{ | ||
"name": "@dewib/dw-api", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Wrap all your request into one place and map your response for your needs", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
11614
204