kui-crm_actions 0.0.132 → 0.0.134

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
@@ -295,6 +295,7 @@ type InventoryInspectionFormFields = CommonInspectionFormFields &
295
295
  InspectionRoomsImagesFields
296
296
 
297
297
  declare const inspectionsRequests: {
298
+ getInspectionTypes(apartmentId: number): Promise<InspectionTypes[] | undefined>;
298
299
  createInspection(apartmentId: number, body: any, loader: Loader): Promise<number | undefined>;
299
300
  createInitialInspection(data: InitialInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
300
301
  createRegularInspection(data: RegularInspectionFormFields, apartmentId: number, loader: Loader): Promise<number | null | undefined>;
package/index.js CHANGED
@@ -348,6 +348,19 @@ var inspectionsRequestBody = {
348
348
  };
349
349
 
350
350
  var inspectionsRequests = {
351
+ getInspectionTypes: function (apartmentId) {
352
+ return __awaiter(this, void 0, void 0, function () {
353
+ var _a, res;
354
+ return __generator(this, function (_b) {
355
+ switch (_b.label) {
356
+ case 0: return [4 /*yield*/, to(requests.get("/list/inspection_types?apartment=".concat(apartmentId)))];
357
+ case 1:
358
+ _a = _b.sent(), _a[0], res = _a[1];
359
+ return [2 /*return*/, res];
360
+ }
361
+ });
362
+ });
363
+ },
351
364
  createInspection: function (apartmentId, body, loader) {
352
365
  var _a;
353
366
  return __awaiter(this, void 0, void 0, function () {
@@ -1025,8 +1038,8 @@ var getRoomsImagesSteps = function (type, settings, roomsParams) { return __spre
1025
1038
  __assign({ type: "kitchen" }, settings.kitchen)
1026
1039
  ], new Array(Number((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.bedroomsNumber) || 0))
1027
1040
  .fill(0)
1028
- .map(function (_, index) { return (__assign({ type: "bedroom" }, settings.bedroom((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.bedroomsNumber) ? "".concat(index + 1, " ") : ""))); }), true), new Array(Number((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.roomsNumber) || 0) -
1029
- Number((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.bedroomsNumber) || 0))
1041
+ .map(function (_, index) { return (__assign({ type: "bedroom" }, settings.bedroom((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.bedroomsNumber) ? "".concat(index + 1, " ") : ""))); }), true), new Array(Math.max(Number((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.roomsNumber) || 0) -
1042
+ Number((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.bedroomsNumber) || 0), 0))
1030
1043
  .fill(0)
1031
1044
  .map(function (_, index) { return (__assign({ type: "room" }, settings.room((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.roomsNumber)
1032
1045
  ? "".concat(index + 1 + ((roomsParams === null || roomsParams === void 0 ? void 0 : roomsParams.bedroomsNumber) || 0), " ")