@churchillliving/se-ui-toolkit 6.52.77 → 6.52.80

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.
@@ -8994,13 +8994,14 @@
8994
8994
  this.requestService = requestService;
8995
8995
  this.alertService = alertService;
8996
8996
  }
8997
- CardService.prototype.deleteImage = function (imageInfo, uniqueKey, dynamicForm, cardId) {
8997
+ CardService.prototype.deleteImage = function (imageInfo, uniqueKey, dynamicForm, cardId, deleteMatchKey) {
8998
8998
  var _this = this;
8999
+ if (deleteMatchKey === void 0) { deleteMatchKey = ''; }
8999
9000
  var imageToDelete = imageInfo.id && imageInfo.id > 0
9000
9001
  ? { RecordId: imageInfo.id }
9001
9002
  : { UniqueKey: uniqueKey, RecordId: imageInfo.recordId };
9002
9003
  this.requestService.get('/Upload/Delete', imageToDelete).subscribe(function (response) {
9003
- _this.deleteFile(imageInfo, dynamicForm, cardId);
9004
+ _this.deleteFile(imageInfo, dynamicForm, cardId, deleteMatchKey);
9004
9005
  if (imageInfo.tables) {
9005
9006
  _this.deleteImageFromTables(imageInfo.tables, uniqueKey);
9006
9007
  }
@@ -9051,10 +9052,10 @@
9051
9052
  });
9052
9053
  }
9053
9054
  };
9054
- CardService.prototype.deleteFile = function (cardInfo, dynamicForm, id) {
9055
+ CardService.prototype.deleteFile = function (cardInfo, dynamicForm, id, deleteMatchKey) {
9055
9056
  var _a, _b;
9056
9057
  var cardData = (_a = this.getCardData(dynamicForm.formSections, id)) === null || _a === void 0 ? void 0 : _a.data;
9057
- cardData = __spreadArray([], __read(this.deleteFromArray(cardData, cardInfo)));
9058
+ cardData = __spreadArray([], __read(this.deleteFromArray(cardData, cardInfo, deleteMatchKey)));
9058
9059
  (_b = dynamicForm.formSections) === null || _b === void 0 ? void 0 : _b.forEach(function (section) {
9059
9060
  var card = section.fields.find(function (x) { return x.control === exports.EFormControl.CARD && x.id === id; });
9060
9061
  if (card && card.card) {
@@ -9062,11 +9063,11 @@
9062
9063
  }
9063
9064
  });
9064
9065
  };
9065
- CardService.prototype.deleteFromArray = function (arr, cardInfo) {
9066
+ CardService.prototype.deleteFromArray = function (arr, cardInfo, deleteMatchKey) {
9066
9067
  if (arr === void 0) { arr = []; }
9067
9068
  arr = setDataFields(arr);
9068
9069
  cardInfo = objConvertToLower(cardInfo);
9069
- var index = arr.findIndex(function (i) { return i.blobfileurl === cardInfo.blobfileurl; });
9070
+ var index = arr.findIndex(function (i) { return i[deleteMatchKey] === cardInfo[deleteMatchKey]; });
9070
9071
  if (index > -1) {
9071
9072
  arr.splice(index, 1);
9072
9073
  }