@radio-retail/api-client
Advanced tools
Comparing version 6.0.28 to 6.0.29
@@ -20,3 +20,4 @@ const etagMap = new Map(); | ||
if (etag) { | ||
config.headers['If-Match'] = etag.replace(new RegExp('"', 'g'), ''); | ||
// eslint-disable-next-line | ||
config.headers['If-Match'] = etag.replace(new RegExp(/"/, 'g'), ''); | ||
config.headers['Content-Type'] = 'application/merge-patch+json'; | ||
@@ -36,3 +37,2 @@ } | ||
if (etag) { | ||
console.log(`Setting Etag for ${response.config.url} to ${etag}`); | ||
etagMap.set(response.config.url, etag); | ||
@@ -39,0 +39,0 @@ } |
@@ -5,3 +5,2 @@ module.exports = function getData(res) { | ||
if (data.data) { | ||
console.log(data); | ||
return data.data; | ||
@@ -8,0 +7,0 @@ } |
@@ -1,2 +0,2 @@ | ||
const getData = require("../utils/get-raw-data"); | ||
const getData = require('../utils/get-raw-data'); | ||
@@ -55,3 +55,3 @@ function methods(instance, baseRoute) { | ||
toggleActive(id, active, config = {}) { | ||
return instance.post(`${baseRoute}/${id}/${active ? "activate" : "deactivate"}`, config).then(getData(config.raw)); | ||
return instance.post(`${baseRoute}/${id}/${active ? 'activate' : 'deactivate'}`, config).then(getData(config.raw)); | ||
}, | ||
@@ -73,3 +73,3 @@ | ||
headers: { ...(prevConfig.headers || {}), | ||
"Content-Type": prevConfig.type === "json" ? "application/json-patch+json" : "application/merge-patch+json" | ||
'Content-Type': prevConfig.type === 'json' ? 'application/json-patch+json' : 'application/merge-patch+json' | ||
} | ||
@@ -76,0 +76,0 @@ }; |
@@ -7,3 +7,3 @@ function axiosTokenIntercept(axios) { | ||
if (token) { | ||
config.headers['Authorization'] = `Bearer ${token}`; | ||
config.headers.Authorization = `Bearer ${token}`; | ||
} | ||
@@ -10,0 +10,0 @@ } |
{ | ||
"name": "@radio-retail/api-client", | ||
"description": "Radio Retail API client", | ||
"version": "6.0.28", | ||
"version": "6.0.29", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prepare": "npm run build", | ||
"lint:fix": "standard --fix \"./src/**/*.js\"", | ||
"lint": "standard \"./src/**/*.js\"", | ||
"lint:fix": "standard --fix \"./**/*.js\"", | ||
"lint": "standard \"./**/*.js\"", | ||
"build": "babel src -d dist", | ||
"check": "npm-check -u" | ||
"check": "npm-check -u", | ||
"commit": "cz", | ||
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0" | ||
}, | ||
@@ -23,4 +25,9 @@ "files": [ | ||
"@babel/runtime": "^7.10.3", | ||
"@commitlint/cli": "^11.0.0", | ||
"@commitlint/config-conventional": "^11.0.0", | ||
"axios": "^0.21.0", | ||
"babel-eslint": "^10.1.0", | ||
"commitizen": "^4.2.2", | ||
"conventional-changelog-cli": "^2.1.1", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"dotenv": "^8.2.0", | ||
@@ -43,2 +50,3 @@ "husky": "^4.2.5", | ||
"hooks": { | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS", | ||
"pre-commit": "lint-staged" | ||
@@ -50,3 +58,8 @@ } | ||
"*.{css,md}": "prettier --write" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "./node_modules/cz-conventional-changelog" | ||
} | ||
} | ||
} |
# @radio-retail/api-client | ||
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) | ||
> Radio Retail API client | ||
@@ -8,6 +10,5 @@ | ||
```js | ||
import api from '@radio-retail/api-client' | ||
import api from "@radio-retail/api-client"; | ||
``` | ||
## Install | ||
@@ -14,0 +15,0 @@ |
21566
36
20
479