@panneau/data 2.0.46 → 2.0.52

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 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
- return baseUrl !== null ? "".concat(baseUrl.replace(/\/$/, ''), "/").concat(path.replace(/^\//, '')) : path;
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
- return baseUrl !== null ? "".concat(baseUrl.replace(/\/$/, ''), "/").concat(path.replace(/^\//, '')) : path;
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.46",
3
+ "version": "2.0.52",
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.46",
57
+ "@panneau/core": "^2.0.51",
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": "566fca41a31122cbbcda4b98cb8395e56eaf9336"
65
+ "gitHead": "309ddad48f39c784211e6706c9143e5763b5795f"
66
66
  }