kui-crm_actions 0.0.149 → 0.0.151

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/cjs/index.js CHANGED
@@ -385,26 +385,30 @@ var inspectionsRequestBody = {
385
385
  var inspectionsRequests = {
386
386
  getInspectionTypes: function (apartmentId) {
387
387
  return __awaiter(this, void 0, void 0, function () {
388
- var _a, res;
388
+ var _a, err, res;
389
389
  return __generator(this, function (_b) {
390
390
  switch (_b.label) {
391
391
  case 0: return [4 /*yield*/, to__default["default"](kuiCrm.requests.get("/apartments/".concat(apartmentId, "/inspection-types")))];
392
392
  case 1:
393
- _a = _b.sent(), _a[0], res = _a[1];
394
- return [2 /*return*/, res === null || res === void 0 ? void 0 : res.inspection_types];
393
+ _a = _b.sent(), err = _a[0], res = _a[1];
394
+ if (err)
395
+ return [2 /*return*/, [err, undefined]];
396
+ return [2 /*return*/, [null, res === null || res === void 0 ? void 0 : res.inspection_types]];
395
397
  }
396
398
  });
397
399
  });
398
400
  },
399
401
  getTransferTypes: function (apartmentId) {
400
402
  return __awaiter(this, void 0, void 0, function () {
401
- var _a, res;
403
+ var _a, err, res;
402
404
  return __generator(this, function (_b) {
403
405
  switch (_b.label) {
404
406
  case 0: return [4 /*yield*/, to__default["default"](kuiCrm.requests.get("/apartments/".concat(apartmentId, "/transfer-inspection-types")))];
405
407
  case 1:
406
- _a = _b.sent(), _a[0], res = _a[1];
407
- return [2 /*return*/, res === null || res === void 0 ? void 0 : res.transfer_inspection_types];
408
+ _a = _b.sent(), err = _a[0], res = _a[1];
409
+ if (err)
410
+ return [2 /*return*/, [err, undefined]];
411
+ return [2 /*return*/, [null, res === null || res === void 0 ? void 0 : res.transfer_inspection_types]];
408
412
  }
409
413
  });
410
414
  });