@hapl/api-queries 0.1.73 → 0.1.74

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.
@@ -298,29 +298,30 @@ function findPublishedExpertsRequest(_ref) {
298
298
  },
299
299
  headers: {
300
300
  Accept: 'application/json'
301
- }
302
- }).then(function (res) {
303
- var data = {
304
- data: {
305
- byId: {},
306
- ids: []
307
- },
308
- meta: {
309
- total: res.data.pageParams.length
301
+ },
302
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
303
+ if (data.success) {
304
+ var ids = [];
305
+ var byId = {};
306
+ data.data.forEach(function (entity) {
307
+ byId[entity.id] = entity;
308
+ ids.push(entity.id);
309
+ });
310
+ return {
311
+ ids: ids,
312
+ byId: byId,
313
+ meta: {
314
+ total: data.pageParams.length
315
+ }
316
+ };
310
317
  }
311
- };
312
- res.data.data.forEach(function (entity) {
313
- data.data.byId[entity.id] = entity;
314
- data.data.ids.push(entity.id);
315
- });
316
- return data;
317
- })["catch"](function (err) {
318
- var _err$response$status, _err$response, _err$response$data$da, _err$response2;
319
318
 
320
- var error = new Error(err.message);
321
- error.status = (_err$response$status = (_err$response = err.response) == null ? void 0 : _err$response.status) != null ? _err$response$status : 520;
322
- error.data = (_err$response$data$da = (_err$response2 = err.response) == null ? void 0 : _err$response2.data.data.error) != null ? _err$response$data$da : 'Unknown Error';
323
- throw error;
319
+ return data.data.error;
320
+ }])
321
+ }).then(function (res) {
322
+ return res;
323
+ })["catch"](function (err) {
324
+ throw err;
324
325
  });
325
326
  }
326
327