@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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v0.1.74 (Wed Oct 20 2021)
2
+
3
+ #### ⚠️ Pushed to `main`
4
+
5
+ - refactor published experts api ([@yeshkarluk](https://github.com/yeshkarluk))
6
+
7
+ #### Authors: 1
8
+
9
+ - Ivan Ignatev ([@yeshkarluk](https://github.com/yeshkarluk))
10
+
11
+ ---
12
+
1
13
  # v0.1.73 (Tue Sep 21 2021)
2
14
 
3
15
  #### ⚠️ Pushed to `main`
@@ -304,29 +304,30 @@ function findPublishedExpertsRequest(_ref) {
304
304
  },
305
305
  headers: {
306
306
  Accept: 'application/json'
307
- }
308
- }).then(function (res) {
309
- var data = {
310
- data: {
311
- byId: {},
312
- ids: []
313
- },
314
- meta: {
315
- total: res.data.pageParams.length
307
+ },
308
+ transformResponse: [].concat(axios.defaults.transformResponse, [function (data) {
309
+ if (data.success) {
310
+ var ids = [];
311
+ var byId = {};
312
+ data.data.forEach(function (entity) {
313
+ byId[entity.id] = entity;
314
+ ids.push(entity.id);
315
+ });
316
+ return {
317
+ ids: ids,
318
+ byId: byId,
319
+ meta: {
320
+ total: data.pageParams.length
321
+ }
322
+ };
316
323
  }
317
- };
318
- res.data.data.forEach(function (entity) {
319
- data.data.byId[entity.id] = entity;
320
- data.data.ids.push(entity.id);
321
- });
322
- return data;
323
- })["catch"](function (err) {
324
- var _err$response$status, _err$response, _err$response$data$da, _err$response2;
325
324
 
326
- var error = new Error(err.message);
327
- error.status = (_err$response$status = (_err$response = err.response) == null ? void 0 : _err$response.status) != null ? _err$response$status : 520;
328
- 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';
329
- throw error;
325
+ return data.data.error;
326
+ }])
327
+ }).then(function (res) {
328
+ return res;
329
+ })["catch"](function (err) {
330
+ throw err;
330
331
  });
331
332
  }
332
333