kui-crm_actions 0.0.149 → 0.0.150

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/index.d.ts CHANGED
@@ -502,8 +502,8 @@ type InventoryInspectionPostFormFields = {
502
502
  } & Omit<InventoryInspectionFormFields, "fillingList">
503
503
 
504
504
  declare const inspectionsRequests: {
505
- getInspectionTypes(apartmentId: number): Promise<InspectionTypes[] | undefined>;
506
- getTransferTypes(apartmentId: number): Promise<TransferInspectionTypes[] | undefined>;
505
+ getInspectionTypes(apartmentId: number): Promise<(Error | undefined)[] | (InspectionTypes[] | null)[]>;
506
+ getTransferTypes(apartmentId: number): Promise<(Error | undefined)[] | (TransferInspectionTypes[] | null)[]>;
507
507
  createInspection(apartmentId: number, body: any, loader: Loader): Promise<number | undefined>;
508
508
  createInitialInspection(data: InitialInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
509
509
  createRegularInspection(data: RegularInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
package/index.js CHANGED
@@ -356,26 +356,30 @@ var inspectionsRequestBody = {
356
356
  var inspectionsRequests = {
357
357
  getInspectionTypes: function (apartmentId) {
358
358
  return __awaiter(this, void 0, void 0, function () {
359
- var _a, res;
359
+ var _a, err, res;
360
360
  return __generator(this, function (_b) {
361
361
  switch (_b.label) {
362
362
  case 0: return [4 /*yield*/, to(requests.get("/apartments/".concat(apartmentId, "/inspection-types")))];
363
363
  case 1:
364
- _a = _b.sent(), _a[0], res = _a[1];
365
- return [2 /*return*/, res === null || res === void 0 ? void 0 : res.inspection_types];
364
+ _a = _b.sent(), err = _a[0], res = _a[1];
365
+ if (err)
366
+ return [2 /*return*/, [err, undefined]];
367
+ return [2 /*return*/, [null, res === null || res === void 0 ? void 0 : res.inspection_types]];
366
368
  }
367
369
  });
368
370
  });
369
371
  },
370
372
  getTransferTypes: function (apartmentId) {
371
373
  return __awaiter(this, void 0, void 0, function () {
372
- var _a, res;
374
+ var _a, err, res;
373
375
  return __generator(this, function (_b) {
374
376
  switch (_b.label) {
375
377
  case 0: return [4 /*yield*/, to(requests.get("/apartments/".concat(apartmentId, "/transfer-inspection-types")))];
376
378
  case 1:
377
- _a = _b.sent(), _a[0], res = _a[1];
378
- return [2 /*return*/, res === null || res === void 0 ? void 0 : res.transfer_inspection_types];
379
+ _a = _b.sent(), err = _a[0], res = _a[1];
380
+ if (err)
381
+ return [2 /*return*/, [err, undefined]];
382
+ return [2 /*return*/, [null, res === null || res === void 0 ? void 0 : res.transfer_inspection_types]];
379
383
  }
380
384
  });
381
385
  });