@twreporter/redux
Advanced tools
Comparing version 8.1.0-rc.0 to 8.1.0-rc.1
@@ -6,2 +6,13 @@ # Change Log | ||
# [8.1.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/redux@8.1.0-rc.0...@twreporter/redux@8.1.0-rc.1) (2024-07-09) | ||
### Features | ||
* add jwt for getting full post ([d5d0f16](https://github.com/twreporter/twreporter-npm-packages/commit/d5d0f16ae807882254c318488f97904aef50e18e)) | ||
# [8.1.0-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/redux@8.0.3...@twreporter/redux@8.1.0-rc.0) (2024-07-09) | ||
@@ -8,0 +19,0 @@ |
@@ -43,2 +43,3 @@ "use strict"; | ||
* @param {string} slug - slug of post | ||
* @param {string} jwt - access_token granted for the user | ||
* @param {number} [timeout=apiConfig.timeout] - request api timeout | ||
@@ -48,3 +49,4 @@ * @return {import('../typedef').Thunk} async action creator | ||
function fetchAFullPost(slug) { | ||
var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _apiConfig["default"].timeout; | ||
var jwt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | ||
var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _apiConfig["default"].timeout; | ||
return function (dispatch, getState) { | ||
@@ -86,3 +88,4 @@ var state = getState(); | ||
var url = (0, _url.formURL)(apiOrigin, path, { | ||
full: 'true' | ||
full: 'true', | ||
toggleBookmark: 'true' | ||
}); | ||
@@ -96,5 +99,12 @@ // Start to get topics | ||
}); | ||
return _axios["default"].get(url, { | ||
var config = { | ||
timeout: timeout | ||
}).then(function (response) { | ||
}; | ||
if (jwt) { | ||
config.headers = { | ||
Authorization: "Bearer ".concat(jwt) | ||
}; | ||
config.withCredentials = true; | ||
} | ||
return _axios["default"].get(url, config).then(function (response) { | ||
var successAction = { | ||
@@ -101,0 +111,0 @@ type: _actionTypes["default"].selectedPost.read.success, |
{ | ||
"name": "@twreporter/redux", | ||
"version": "8.1.0-rc.0", | ||
"version": "8.1.0-rc.1", | ||
"description": "redux actions and reducers for twreporter website", | ||
@@ -49,3 +49,3 @@ "repository": "https://github.com/twreporter/twreporter-npm-packages.git", | ||
], | ||
"gitHead": "818d27707d41db85fb9f095ae14fdfd391555550" | ||
"gitHead": "d3003a89e37a0f2ef1fe5e5424b6d6e13a9028db" | ||
} |
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
298238
5885