@easydata/crud 1.4.7 → 1.4.8

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.
@@ -5800,6 +5800,14 @@ var HttpClient = /** @class */ (function () {
5800
5800
  this.defaultHeaders = {};
5801
5801
  this.customPayload = undefined;
5802
5802
  }
5803
+ Object.defineProperty(HttpClient.prototype, "responseBody", {
5804
+ /** Gets the response body for the latest request */
5805
+ get: function () {
5806
+ return this._responseBody;
5807
+ },
5808
+ enumerable: true,
5809
+ configurable: true
5810
+ });
5803
5811
  HttpClient.prototype.get = function (url, options) {
5804
5812
  return this.send(_http_method__WEBPACK_IMPORTED_MODULE_2__[/* HttpMethod */ "a"].Get, url, null, options);
5805
5813
  };
@@ -5813,6 +5821,7 @@ var HttpClient = /** @class */ (function () {
5813
5821
  return this.send(_http_method__WEBPACK_IMPORTED_MODULE_2__[/* HttpMethod */ "a"].Delete, url, data, options);
5814
5822
  };
5815
5823
  HttpClient.prototype.send = function (method, url, data, options) {
5824
+ var _this = this;
5816
5825
  options = options || {};
5817
5826
  var dataType = options.dataType || 'json';
5818
5827
  var contentType = options.contentType || (dataType !== 'form-data')
@@ -5868,6 +5877,10 @@ var HttpClient = /** @class */ (function () {
5868
5877
  : (responseContentType.indexOf('application/json') == 0
5869
5878
  ? JSON.parse(xhr.responseText)
5870
5879
  : xhr.responseText);
5880
+ _this._responseBody = responseObj;
5881
+ if (_this.onResponse) {
5882
+ _this.onResponse(xhr);
5883
+ }
5871
5884
  resolve(responseObj);
5872
5885
  }
5873
5886
  else {
@@ -5879,6 +5892,7 @@ var HttpClient = /** @class */ (function () {
5879
5892
  var responseObj = (responseContentType.indexOf('application/json') == 0)
5880
5893
  ? JSON.parse(responseText)
5881
5894
  : responseText;
5895
+ _this._responseBody = responseObj;
5882
5896
  var message = responseObj.message ||
5883
5897
  (status == 404
5884
5898
  ? "No such endpoint: " + url