@panneau/data 2.0.51 → 2.0.56
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 -2
- package/lib/index.js +3 -2
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -398,7 +398,7 @@ var Base = /*#__PURE__*/function () {
|
|
|
398
398
|
key: "requestDelete",
|
|
399
399
|
value: function requestDelete(path) {
|
|
400
400
|
var _this5 = this;
|
|
401
|
-
return this.requestPost(path, {
|
|
401
|
+
return this.requestPost(this.getFullUrl(path), {
|
|
402
402
|
_method: 'DELETE'
|
|
403
403
|
})["catch"](function (error) {
|
|
404
404
|
return _this5.onError(error);
|
|
@@ -421,7 +421,8 @@ var Base = /*#__PURE__*/function () {
|
|
|
421
421
|
value: function getFullUrl(path) {
|
|
422
422
|
var _this$options$baseUrl = this.options.baseUrl,
|
|
423
423
|
baseUrl = _this$options$baseUrl === void 0 ? null : _this$options$baseUrl;
|
|
424
|
-
|
|
424
|
+
var hasProtocol = path.indexOf('://') !== -1;
|
|
425
|
+
return baseUrl !== null && !hasProtocol ? "".concat(baseUrl.replace(/\/$/, ''), "/").concat(path.replace(/^\//, '')) : path;
|
|
425
426
|
}
|
|
426
427
|
}, {
|
|
427
428
|
key: "onError",
|
package/lib/index.js
CHANGED
|
@@ -417,7 +417,7 @@ var Base = /*#__PURE__*/function () {
|
|
|
417
417
|
key: "requestDelete",
|
|
418
418
|
value: function requestDelete(path) {
|
|
419
419
|
var _this5 = this;
|
|
420
|
-
return this.requestPost(path, {
|
|
420
|
+
return this.requestPost(this.getFullUrl(path), {
|
|
421
421
|
_method: 'DELETE'
|
|
422
422
|
})["catch"](function (error) {
|
|
423
423
|
return _this5.onError(error);
|
|
@@ -440,7 +440,8 @@ var Base = /*#__PURE__*/function () {
|
|
|
440
440
|
value: function getFullUrl(path) {
|
|
441
441
|
var _this$options$baseUrl = this.options.baseUrl,
|
|
442
442
|
baseUrl = _this$options$baseUrl === void 0 ? null : _this$options$baseUrl;
|
|
443
|
-
|
|
443
|
+
var hasProtocol = path.indexOf('://') !== -1;
|
|
444
|
+
return baseUrl !== null && !hasProtocol ? "".concat(baseUrl.replace(/\/$/, ''), "/").concat(path.replace(/^\//, '')) : path;
|
|
444
445
|
}
|
|
445
446
|
}, {
|
|
446
447
|
key: "onError",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/data",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.56",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -54,7 +54,7 @@
|
|
|
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.56",
|
|
58
58
|
"prop-types": "^15.7.2",
|
|
59
59
|
"query-string": "^8.1.0",
|
|
60
60
|
"react-router": "^6.2.1"
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "edb76a5622f04136db62c1dd0c4b2e362de6878a"
|
|
66
66
|
}
|