@hmcts/ccd-case-ui-toolkit 6.13.11-linked-reasons-sorting → 6.13.11-linked-reasons-sorting-fix

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.
@@ -16991,7 +16991,8 @@
16991
16991
  LinkedCasesToTableComponent.prototype.sortReasonCodes = function (searchCasesResponse) {
16992
16992
  var _this = this;
16993
16993
  searchCasesResponse.forEach(function (item) {
16994
- if (item && item.reasons && item.reasons.length) {
16994
+ var _a;
16995
+ if ((_a = item === null || item === void 0 ? void 0 : item.reasons) === null || _a === void 0 ? void 0 : _a.length) {
16995
16996
  item.reasons.forEach(function (reason) {
16996
16997
  reason.sortOrder = _this.getReasonSortOrder(reason.value.Reason);
16997
16998
  });
@@ -16999,7 +17000,7 @@
16999
17000
  item.sortOrder = item.reasons[0].sortOrder;
17000
17001
  }
17001
17002
  });
17002
- searchCasesResponse = searchCasesResponse && searchCasesResponse.sort(function (a, b) { return a.sortOrder - b.sortOrder; });
17003
+ searchCasesResponse = searchCasesResponse === null || searchCasesResponse === void 0 ? void 0 : searchCasesResponse.sort(function (a, b) { return a.sortOrder - b.sortOrder; });
17003
17004
  return searchCasesResponse;
17004
17005
  };
17005
17006
  LinkedCasesToTableComponent.prototype.getReasonSortOrder = function (reasonCode) {
@@ -17009,9 +17010,7 @@
17009
17010
  else if (reasonCode === LinkedCasesToTableComponent.CASE_CONSOLIDATED_REASON_CODE) {
17010
17011
  return 2;
17011
17012
  }
17012
- else {
17013
- return 3;
17014
- }
17013
+ return 3;
17015
17014
  };
17016
17015
  LinkedCasesToTableComponent.prototype.searchCasesByCaseIds = function (searchCasesResponse) {
17017
17016
  return rxjs.forkJoin(searchCasesResponse);