@panneau/data 2.0.0 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.js +3 -3
- package/lib/index.js +4 -3
- package/package.json +4 -4
package/es/index.js
CHANGED
|
@@ -11,8 +11,8 @@ import _assertThisInitialized from '@babel/runtime/helpers/assertThisInitialized
|
|
|
11
11
|
import _inherits from '@babel/runtime/helpers/inherits';
|
|
12
12
|
import _createSuper from '@babel/runtime/helpers/createSuper';
|
|
13
13
|
import { getJSON, getCSRFHeaders, postJSON } from '@folklore/fetch';
|
|
14
|
+
import queryString from 'query-string';
|
|
14
15
|
import { generatePath } from 'react-router';
|
|
15
|
-
import { stringify } from 'query-string';
|
|
16
16
|
|
|
17
17
|
var useData = function useData(loadData) {
|
|
18
18
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
@@ -301,10 +301,10 @@ var Base = /*#__PURE__*/function () {
|
|
|
301
301
|
value: function requestGet(path) {
|
|
302
302
|
var _this = this;
|
|
303
303
|
var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
304
|
-
var
|
|
304
|
+
var finalQuery = query !== null ? queryString.stringify(query, {
|
|
305
305
|
arrayFormat: 'bracket'
|
|
306
306
|
}) : null;
|
|
307
|
-
return getJSON("".concat(this.getFullUrl(path)).concat(
|
|
307
|
+
return getJSON("".concat(this.getFullUrl(path)).concat(finalQuery !== null && finalQuery.length > 0 ? "?".concat(finalQuery) : ''), {
|
|
308
308
|
credentials: 'include',
|
|
309
309
|
headers: getCSRFHeaders()
|
|
310
310
|
})["catch"](function (error) {
|
package/lib/index.js
CHANGED
|
@@ -15,8 +15,8 @@ var _assertThisInitialized = require('@babel/runtime/helpers/assertThisInitializ
|
|
|
15
15
|
var _inherits = require('@babel/runtime/helpers/inherits');
|
|
16
16
|
var _createSuper = require('@babel/runtime/helpers/createSuper');
|
|
17
17
|
var fetch$1 = require('@folklore/fetch');
|
|
18
|
-
var reactRouter = require('react-router');
|
|
19
18
|
var queryString = require('query-string');
|
|
19
|
+
var reactRouter = require('react-router');
|
|
20
20
|
|
|
21
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
22
|
|
|
@@ -31,6 +31,7 @@ var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallChec
|
|
|
31
31
|
var _assertThisInitialized__default = /*#__PURE__*/_interopDefaultLegacy(_assertThisInitialized);
|
|
32
32
|
var _inherits__default = /*#__PURE__*/_interopDefaultLegacy(_inherits);
|
|
33
33
|
var _createSuper__default = /*#__PURE__*/_interopDefaultLegacy(_createSuper);
|
|
34
|
+
var queryString__default = /*#__PURE__*/_interopDefaultLegacy(queryString);
|
|
34
35
|
|
|
35
36
|
var useData = function useData(loadData) {
|
|
36
37
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
@@ -319,10 +320,10 @@ var Base = /*#__PURE__*/function () {
|
|
|
319
320
|
value: function requestGet(path) {
|
|
320
321
|
var _this = this;
|
|
321
322
|
var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
322
|
-
var
|
|
323
|
+
var finalQuery = query !== null ? queryString__default["default"].stringify(query, {
|
|
323
324
|
arrayFormat: 'bracket'
|
|
324
325
|
}) : null;
|
|
325
|
-
return fetch$1.getJSON("".concat(this.getFullUrl(path)).concat(
|
|
326
|
+
return fetch$1.getJSON("".concat(this.getFullUrl(path)).concat(finalQuery !== null && finalQuery.length > 0 ? "?".concat(finalQuery) : ''), {
|
|
326
327
|
credentials: 'include',
|
|
327
328
|
headers: fetch$1.getCSRFHeaders()
|
|
328
329
|
})["catch"](function (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/data",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@babel/runtime": "^7.12.5",
|
|
56
56
|
"@folklore/fetch": "^0.1.15",
|
|
57
|
-
"@panneau/core": "^2.0.
|
|
57
|
+
"@panneau/core": "^2.0.2",
|
|
58
58
|
"prop-types": "^15.7.2",
|
|
59
|
-
"query-string": "^7.0.0",
|
|
59
|
+
"query-string": "^7.0.0||^8.1.0",
|
|
60
60
|
"react-router": "^6.2.1"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "eb99739fb81a02464eccb6a131b3e36a436de294"
|
|
66
66
|
}
|