bruce-models 0.5.0 → 0.5.2

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.
@@ -1209,6 +1209,30 @@
1209
1209
  });
1210
1210
  }
1211
1211
  Entity.Delete = Delete;
1212
+ function DeleteList(api, entityIds) {
1213
+ return __awaiter(this, void 0, void 0, function () {
1214
+ var i, entityId;
1215
+ return __generator(this, function (_a) {
1216
+ switch (_a.label) {
1217
+ case 0:
1218
+ if (!(entityIds === null || entityIds === void 0 ? void 0 : entityIds.length)) {
1219
+ throw ("Entity IDs are required.");
1220
+ }
1221
+ return [4 /*yield*/, api.POST("deleteEntities", {
1222
+ Items: entityIds
1223
+ }, exports.Api.PrepReqParams())];
1224
+ case 1:
1225
+ _a.sent();
1226
+ for (i = 0; i < entityIds.length; i++) {
1227
+ entityId = entityIds[i];
1228
+ api.Cache.Remove(GetCacheKey(entityId));
1229
+ }
1230
+ return [2 /*return*/];
1231
+ }
1232
+ });
1233
+ });
1234
+ }
1235
+ Entity.DeleteList = DeleteList;
1212
1236
  function Update(api, data, override) {
1213
1237
  var _a, _b;
1214
1238
  return __awaiter(this, void 0, void 0, function () {
@@ -2625,14 +2649,14 @@
2625
2649
  url = "entity/" + data["Principal.Entity.ID"] + "/relation/" + data["Relation.Type.ID"] + "/add";
2626
2650
  return [4 /*yield*/, api.POST(url, reqData, exports.Api.PrepReqParams())];
2627
2651
  case 1:
2628
- data = _a.sent();
2652
+ _a.sent();
2629
2653
  api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + data["Principal.Entity.ID"]);
2630
2654
  api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Id + data["Related.Entity.ID"]);
2631
2655
  api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.RelationType + exports.Api.ECacheKey.Id + data["Relation.Type.ID"]);
2632
2656
  if (data["Data.Entity.ID"]) {
2633
2657
  api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.Relation + exports.Api.ECacheKey.Entity + exports.Api.ECacheKey.Id + data["Data.Entity.ID"]);
2634
2658
  }
2635
- return [2 /*return*/, data];
2659
+ return [2 /*return*/];
2636
2660
  }
2637
2661
  });
2638
2662
  });