spice-js 2.6.62 → 2.6.64

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.
@@ -897,7 +897,7 @@ class SpiceModel {
897
897
  } else {
898
898
  delete results["id"];
899
899
  results.deleted = true;
900
- delete_response = yield _this11.database.update(args.id, "");
900
+ delete_response = yield _this11.database.update(args.id, results);
901
901
  }
902
902
 
903
903
  if (args.skip_hooks != true) {
@@ -1255,7 +1255,8 @@ class SpiceModel {
1255
1255
  _this15[_mapping_dept];
1256
1256
 
1257
1257
  if (_this15[_level] + 1 < _this15[_mapping_dept]) {
1258
- var classes = _.isArray(Class) ? Class : [Class];
1258
+ var classes = _.compact(_.isArray(Class) ? Class : [Class]);
1259
+
1259
1260
  var ids = [];
1260
1261
 
1261
1262
  _.each(data, result => {
@@ -1321,7 +1322,8 @@ class SpiceModel {
1321
1322
  ids = _.union(ids, items);
1322
1323
  });
1323
1324
 
1324
- var classes = _.isArray(Class) ? Class : [Class];
1325
+ var classes = _.compact(_.isArray(Class) ? Class : [Class]);
1326
+
1325
1327
  var returned_all = yield Promise.allSettled(_.map(classes, obj => {
1326
1328
  return new obj(_extends({}, _this16[_args], {
1327
1329
  skip_cache: _this16[_skip_cache],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spice-js",
3
- "version": "2.6.62",
3
+ "version": "2.6.64",
4
4
  "description": "spice",
5
5
  "main": "build/index.js",
6
6
  "repository": {
@@ -1190,7 +1190,7 @@ export default class SpiceModel {
1190
1190
  this[_mapping_dept];
1191
1191
 
1192
1192
  if (this[_level] + 1 < this[_mapping_dept]) {
1193
- let classes = _.isArray(Class) ? Class : [Class];
1193
+ let classes = _.compact(_.isArray(Class) ? Class : [Class]);
1194
1194
 
1195
1195
  let ids = [];
1196
1196
  _.each(data, (result) => {
@@ -1204,6 +1204,7 @@ export default class SpiceModel {
1204
1204
 
1205
1205
  var returned_all = await Promise.allSettled(
1206
1206
  _.map(classes, (obj) => {
1207
+
1207
1208
  return new obj({
1208
1209
  ...this[_args],
1209
1210
  skip_cache: this[_skip_cache],
@@ -1242,6 +1243,7 @@ export default class SpiceModel {
1242
1243
  store_property,
1243
1244
  property
1244
1245
  ) {
1246
+
1245
1247
  let original_is_array = _.isArray(data);
1246
1248
  if (!original_is_array) {
1247
1249
  data = Array.of(data);
@@ -1263,7 +1265,7 @@ export default class SpiceModel {
1263
1265
  ids = _.union(ids, items);
1264
1266
  });
1265
1267
 
1266
- let classes = _.isArray(Class) ? Class : [Class];
1268
+ let classes = _.compact(_.isArray(Class) ? Class : [Class])
1267
1269
  var returned_all = await Promise.allSettled(
1268
1270
  _.map(classes, (obj) => {
1269
1271
  return new obj({