@hapl/api-queries 0.1.121 → 0.1.122

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.
@@ -4757,29 +4757,32 @@ function findPlannedEventsRowRequest(_ref) {
4757
4757
  },
4758
4758
  headers: _extends({
4759
4759
  Accept: 'application/json'
4760
- }, headers)
4761
- }).then(function (res) {
4762
- var data = {
4763
- data: {
4764
- byId: {},
4765
- ids: []
4766
- },
4767
- meta: {
4768
- total: res.data.pageParams.length
4760
+ }, headers),
4761
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
4762
+ var _ref2, _data$data$error, _data$data;
4763
+
4764
+ if (data.success) {
4765
+ var ids = [];
4766
+ var byId = {};
4767
+ data.data.forEach(function (entity) {
4768
+ byId[entity.id] = entity;
4769
+ ids.push(entity.id);
4770
+ });
4771
+ return {
4772
+ ids: ids,
4773
+ byId: byId,
4774
+ meta: {
4775
+ total: data.pageParams.length
4776
+ }
4777
+ };
4769
4778
  }
4770
- };
4771
- res.data.data.forEach(function (entity) {
4772
- data.data.byId[entity.id] = entity;
4773
- data.data.ids.push(entity.id);
4774
- });
4775
- return data;
4776
- })["catch"](function (err) {
4777
- var _err$response$status, _err$response, _ref2, _err$response$data$me, _err$response2, _err$response3, _err$response3$data$d;
4778
4779
 
4779
- var error = new Error(err.message);
4780
- error.status = (_err$response$status = (_err$response = err.response) == null ? void 0 : _err$response.status) != null ? _err$response$status : 520;
4781
- error.data = (_ref2 = (_err$response$data$me = (_err$response2 = err.response) == null ? void 0 : _err$response2.data.message) != null ? _err$response$data$me : (_err$response3 = err.response) == null ? void 0 : (_err$response3$data$d = _err$response3.data.data) == null ? void 0 : _err$response3$data$d.error) != null ? _ref2 : 'Unknown Error';
4782
- throw error;
4780
+ return (_ref2 = (_data$data$error = (_data$data = data.data) == null ? void 0 : _data$data.error) != null ? _data$data$error : data.message) != null ? _ref2 : 'Unknown Error';
4781
+ }])
4782
+ }).then(function (res) {
4783
+ return res;
4784
+ })["catch"](function (err) {
4785
+ throw err;
4783
4786
  });
4784
4787
  }
4785
4788