@twreporter/redux
Advanced tools
Comparing version 5.0.0-beta.3 to 5.0.0-beta.4
@@ -66,3 +66,4 @@ "use strict"; | ||
return function (dispatch, getState, axiosInstanceWithUserCookie) { | ||
return function (dispatch, getState, _ref) { | ||
var httpClientWithToken = _ref.httpClientWithToken; | ||
var url = (0, _formApiUrl["default"])(apiEndpoints.createSingleBookmark(uesrID), false); | ||
@@ -76,3 +77,3 @@ var axiosConfig = { | ||
}; | ||
var interceptor = axiosInstanceWithUserCookie.interceptors.request.use(function (config) { | ||
var interceptor = httpClientWithToken.interceptors.request.use(function (config) { | ||
var method = config.method, | ||
@@ -91,6 +92,6 @@ url = config.url, | ||
}); | ||
axiosInstanceWithUserCookie.interceptors.request.eject(interceptor); | ||
httpClientWithToken.interceptors.request.eject(interceptor); | ||
return config; | ||
}); | ||
return axiosInstanceWithUserCookie.post(url, _objectSpread({ | ||
return httpClientWithToken.post(url, _objectSpread({ | ||
published_date: Math.ceil(new Date(published_date).getTime() / 1000) | ||
@@ -109,3 +110,4 @@ }, passedBookmarkProperties), axiosConfig).then(function (res) { | ||
function getMultipleBookmarks(jwt, userID, offset, limit, sort) { | ||
return function (dispatch, getState, axiosInstanceWithUserCookie) { | ||
return function (dispatch, getState, _ref2) { | ||
var httpClientWithToken = _ref2.httpClientWithToken; | ||
var url = (0, _formApiUrl["default"])("".concat(apiEndpoints.getBookmarks(userID), "?offset=").concat(offset, "&limit=").concat(limit, "&sort=").concat(sort), false); | ||
@@ -118,3 +120,3 @@ var axiosConfig = { | ||
}; | ||
var interceptor = axiosInstanceWithUserCookie.interceptors.request.use(function (config) { | ||
var interceptor = httpClientWithToken.interceptors.request.use(function (config) { | ||
var method = config.method, | ||
@@ -133,6 +135,6 @@ url = config.url, | ||
}); | ||
axiosInstanceWithUserCookie.interceptors.request.eject(interceptor); | ||
httpClientWithToken.interceptors.request.eject(interceptor); | ||
return config; | ||
}); | ||
return axiosInstanceWithUserCookie.get(url, axiosConfig).then(function (res) { | ||
return httpClientWithToken.get(url, axiosConfig).then(function (res) { | ||
var successAction = buildSuccessActionFromRes(res, _actionTypes["default"].multipleBookMarks.read.success); | ||
@@ -149,3 +151,5 @@ dispatch(successAction); | ||
function getSingleBookmark(jwt, userID, bookmarkSlug, bookmarkHost) { | ||
return function (dispatch, getState, axiosInstanceWithUserCookie) { | ||
return function (dispatch, getState, _ref3) { | ||
var httpClientWithToken = _ref3.httpClientWithToken; | ||
console.log(httpClientWithToken); | ||
var url = (0, _formApiUrl["default"])("".concat(apiEndpoints.getSingleBookmark(userID, bookmarkSlug, bookmarkHost)), false); | ||
@@ -158,3 +162,3 @@ var axiosConfig = { | ||
}; | ||
var interceptor = axiosInstanceWithUserCookie.interceptors.request.use(function (config) { | ||
var interceptor = httpClientWithToken.interceptors.request.use(function (config) { | ||
var method = config.method, | ||
@@ -173,6 +177,6 @@ url = config.url, | ||
}); | ||
axiosInstanceWithUserCookie.interceptors.request.eject(interceptor); | ||
httpClientWithToken.interceptors.request.eject(interceptor); | ||
return config; | ||
}); | ||
return axiosInstanceWithUserCookie.get(url, axiosConfig).then(function (res) { | ||
return httpClientWithToken.get(url, axiosConfig).then(function (res) { | ||
var successAction = buildSuccessActionFromRes(res, _actionTypes["default"].singleBookmark.read.success); | ||
@@ -189,3 +193,4 @@ dispatch(successAction); | ||
function deleteSingleBookmark(jwt, userID, bookmarkID) { | ||
return function (dispatch, getState, axiosInstanceWithUserCookie) { | ||
return function (dispatch, getState, _ref4) { | ||
var httpClientWithToken = _ref4.httpClientWithToken; | ||
var url = (0, _formApiUrl["default"])(apiEndpoints.deleteSingleBookmark(userID, bookmarkID), false); | ||
@@ -198,3 +203,3 @@ var axiosConfig = { | ||
}; | ||
var interceptor = axiosInstanceWithUserCookie.interceptors.request.use(function (config) { | ||
var interceptor = httpClientWithToken.interceptors.request.use(function (config) { | ||
var method = config.method, | ||
@@ -213,6 +218,6 @@ url = config.url, | ||
}); | ||
axiosInstanceWithUserCookie.interceptors.request.eject(interceptor); | ||
httpClientWithToken.interceptors.request.eject(interceptor); | ||
return config; | ||
}); | ||
return axiosInstanceWithUserCookie["delete"](url, axiosConfig).then(function (res) { | ||
return httpClientWithToken["delete"](url, axiosConfig).then(function (res) { | ||
var successAction = buildSuccessActionFromRes(res, _actionTypes["default"].singleBookmark["delete"].success); | ||
@@ -219,0 +224,0 @@ successAction.payload.bookmarkID = bookmarkID; |
@@ -13,2 +13,9 @@ "use strict"; | ||
var selectedTopic = 'selected_topic'; | ||
var articlesByAuthor = 'articlesByAuthor'; | ||
var auth = 'auth'; | ||
var authorsList = 'authorsList'; | ||
var bookmarks = 'bookmarks'; | ||
var bookmarkWidget = 'bookmarkWidget'; | ||
var entitiesForAuthors = 'entitiesForAuthors'; | ||
var searchedAuthorsList = 'searchedAuthorsList'; | ||
var editorPicksSection = 'editor_picks_section'; | ||
@@ -27,2 +34,3 @@ var infographicsSection = 'infographics_section'; | ||
var livingAndMedicalCare = 'living_medical_care'; | ||
var nextNotifyPopupTS = 'nextNotifyPopupTS'; | ||
var postsInEntities = 'posts'; | ||
@@ -55,4 +63,12 @@ var topicsInEntities = 'topics'; | ||
postsInEntities: postsInEntities, | ||
topicsInEntities: topicsInEntities | ||
topicsInEntities: topicsInEntities, | ||
articlesByAuthor: articlesByAuthor, | ||
auth: auth, | ||
authorsList: authorsList, | ||
bookmarks: bookmarks, | ||
bookmarkWidget: bookmarkWidget, | ||
entitiesForAuthors: entitiesForAuthors, | ||
nextNotifyPopupTS: nextNotifyPopupTS, | ||
searchedAuthorsList: searchedAuthorsList | ||
}; | ||
exports["default"] = _default; |
{ | ||
"name": "@twreporter/redux", | ||
"version": "5.0.0-beta.3", | ||
"version": "5.0.0-beta.4", | ||
"description": "redux actions and reducers for twreporter website", | ||
@@ -31,3 +31,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"axios": "^0.16.1", | ||
"axios": "^0.19.0", | ||
"es6-error": "^4.0.2", | ||
@@ -34,0 +34,0 @@ "humps": "^0.6.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
129947
2827
+ Addedaxios@0.19.2(transitive)
+ Addedfollow-redirects@1.5.10(transitive)
- Removedaxios@0.16.2(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedis-buffer@1.1.6(transitive)
Updatedaxios@^0.19.0