@dhyasama/totem-models 12.8.0 → 12.10.0

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/lib/News.js CHANGED
@@ -54,7 +54,7 @@ module.exports = function(mongoose, config) {
54
54
  return result;
55
55
  };
56
56
 
57
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
57
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
58
58
  else { return run(); }
59
59
 
60
60
  };
@@ -85,7 +85,7 @@ module.exports = function(mongoose, config) {
85
85
  return result;
86
86
  };
87
87
 
88
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
88
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
89
89
  else { return run(); }
90
90
 
91
91
  };
@@ -107,7 +107,7 @@ module.exports = function(mongoose, config) {
107
107
  return result;
108
108
  };
109
109
 
110
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
110
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
111
111
  else { return run(); }
112
112
 
113
113
  };
@@ -122,7 +122,7 @@ module.exports = function(mongoose, config) {
122
122
  return await this.findByIdAndUpdate(_id, update, { new: true });
123
123
  };
124
124
 
125
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
125
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
126
126
  else { return run(); }
127
127
 
128
128
  };
package/lib/Note.js CHANGED
@@ -50,7 +50,7 @@ module.exports = function(mongoose, config) {
50
50
  return note;
51
51
  };
52
52
 
53
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
53
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
54
54
  else { return run(); }
55
55
 
56
56
  };
@@ -68,7 +68,7 @@ module.exports = function(mongoose, config) {
68
68
  return createdNote;
69
69
  };
70
70
 
71
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
71
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
72
72
  else { return run(); }
73
73
 
74
74
  };
@@ -91,7 +91,7 @@ module.exports = function(mongoose, config) {
91
91
  return result;
92
92
  };
93
93
 
94
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
94
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
95
95
  else { return run(); }
96
96
 
97
97
  };
@@ -117,7 +117,7 @@ module.exports = function(mongoose, config) {
117
117
  return result;
118
118
  };
119
119
 
120
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
120
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
121
121
  else { return run(); }
122
122
 
123
123
  };
@@ -132,7 +132,7 @@ module.exports = function(mongoose, config) {
132
132
  return await this.findByIdAndUpdate(_id, update, { new: true });
133
133
  };
134
134
 
135
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
135
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
136
136
  else { return run(); }
137
137
 
138
138
  };
@@ -639,10 +639,11 @@ module.exports = function(mongoose, config) {
639
639
  ///////////////////////////////////////////////////////////////////////////////////////
640
640
 
641
641
  Organization.virtual('address.primary').get(function () {
642
- var primary = _.find(this.contact.address, function(address) {
643
- return address.primary;
642
+ var addresses = this && this.contact && this.contact.address ? this.contact.address : [];
643
+ var primary = _.find(addresses, function(address) {
644
+ return address && address.primary;
644
645
  });
645
- return primary ? primary.address : null;
646
+ return primary || null;
646
647
  });
647
648
 
648
649
  Organization.virtual('board.all').get(function () {
@@ -1045,7 +1046,7 @@ module.exports = function(mongoose, config) {
1045
1046
  });
1046
1047
  };
1047
1048
 
1048
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1049
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1049
1050
  else { return run(); }
1050
1051
 
1051
1052
  };
@@ -1070,7 +1071,7 @@ module.exports = function(mongoose, config) {
1070
1071
  return null;
1071
1072
  };
1072
1073
 
1073
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1074
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1074
1075
  else { return run(); }
1075
1076
 
1076
1077
  };
@@ -1126,7 +1127,7 @@ module.exports = function(mongoose, config) {
1126
1127
  return result;
1127
1128
  };
1128
1129
 
1129
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1130
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1130
1131
  else { return run(); }
1131
1132
 
1132
1133
  };
@@ -1141,7 +1142,7 @@ module.exports = function(mongoose, config) {
1141
1142
  return result;
1142
1143
  };
1143
1144
 
1144
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1145
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1145
1146
  else { return run(); }
1146
1147
 
1147
1148
  };
@@ -1172,7 +1173,7 @@ module.exports = function(mongoose, config) {
1172
1173
  return result;
1173
1174
  };
1174
1175
 
1175
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1176
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1176
1177
  else { return run(); }
1177
1178
 
1178
1179
  };
@@ -1208,7 +1209,7 @@ module.exports = function(mongoose, config) {
1208
1209
  return result;
1209
1210
  };
1210
1211
 
1211
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1212
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1212
1213
  else { return run(); }
1213
1214
 
1214
1215
  };
@@ -1227,7 +1228,7 @@ module.exports = function(mongoose, config) {
1227
1228
  return result;
1228
1229
  };
1229
1230
 
1230
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1231
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1231
1232
  else { return run(); }
1232
1233
 
1233
1234
  };
@@ -1254,7 +1255,7 @@ module.exports = function(mongoose, config) {
1254
1255
  return result;
1255
1256
  };
1256
1257
 
1257
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1258
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1258
1259
  else { return run(); }
1259
1260
 
1260
1261
  };
@@ -1268,7 +1269,7 @@ module.exports = function(mongoose, config) {
1268
1269
  return result;
1269
1270
  };
1270
1271
 
1271
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1272
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1272
1273
  else { return run(); }
1273
1274
 
1274
1275
  };
@@ -1280,7 +1281,7 @@ module.exports = function(mongoose, config) {
1280
1281
  return result;
1281
1282
  };
1282
1283
 
1283
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1284
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1284
1285
  else { return run(); }
1285
1286
 
1286
1287
  };
@@ -1292,7 +1293,7 @@ module.exports = function(mongoose, config) {
1292
1293
  return result;
1293
1294
  };
1294
1295
 
1295
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1296
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1296
1297
  else { return run(); }
1297
1298
 
1298
1299
  };
@@ -1371,7 +1372,7 @@ module.exports = function(mongoose, config) {
1371
1372
  return result;
1372
1373
  };
1373
1374
 
1374
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1375
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1375
1376
  else { return run(); }
1376
1377
 
1377
1378
  };
@@ -1410,7 +1411,7 @@ module.exports = function(mongoose, config) {
1410
1411
  return result;
1411
1412
  };
1412
1413
 
1413
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1414
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1414
1415
  else { return run(); }
1415
1416
 
1416
1417
  };
@@ -1451,7 +1452,7 @@ module.exports = function(mongoose, config) {
1451
1452
  return result;
1452
1453
  };
1453
1454
 
1454
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1455
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1455
1456
  else { return run(); }
1456
1457
 
1457
1458
  };
@@ -1463,7 +1464,7 @@ module.exports = function(mongoose, config) {
1463
1464
  return result;
1464
1465
  };
1465
1466
 
1466
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1467
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1467
1468
  else { return run(); }
1468
1469
 
1469
1470
  };
@@ -1475,7 +1476,7 @@ module.exports = function(mongoose, config) {
1475
1476
  return result;
1476
1477
  };
1477
1478
 
1478
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1479
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1479
1480
  else { return run(); }
1480
1481
 
1481
1482
  };
@@ -1501,7 +1502,7 @@ module.exports = function(mongoose, config) {
1501
1502
  return result;
1502
1503
  };
1503
1504
 
1504
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1505
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1505
1506
  else { return run(); }
1506
1507
 
1507
1508
  };
@@ -1525,7 +1526,7 @@ module.exports = function(mongoose, config) {
1525
1526
  return result;
1526
1527
  };
1527
1528
 
1528
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1529
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1529
1530
  else { return run(); }
1530
1531
 
1531
1532
  };
@@ -1540,7 +1541,7 @@ module.exports = function(mongoose, config) {
1540
1541
  return result;
1541
1542
  };
1542
1543
 
1543
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1544
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1544
1545
  else { return run(); }
1545
1546
 
1546
1547
  };
@@ -1593,7 +1594,7 @@ module.exports = function(mongoose, config) {
1593
1594
  else { return helpers.cleanOrg(result, options.CUSTOMER_ID); }
1594
1595
  };
1595
1596
 
1596
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1597
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1597
1598
  else { return run(); }
1598
1599
 
1599
1600
  };
@@ -1610,7 +1611,7 @@ module.exports = function(mongoose, config) {
1610
1611
  return result;
1611
1612
  };
1612
1613
 
1613
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1614
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1614
1615
  else { return run(); }
1615
1616
 
1616
1617
  };
@@ -1636,7 +1637,7 @@ module.exports = function(mongoose, config) {
1636
1637
  else { return _.map(result, function(r) { return helpers.cleanOrg(r, options.CUSTOMER_ID) }); }
1637
1638
  };
1638
1639
 
1639
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1640
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1640
1641
  else { return run(); }
1641
1642
 
1642
1643
  };
@@ -1667,7 +1668,7 @@ module.exports = function(mongoose, config) {
1667
1668
  return result;
1668
1669
  };
1669
1670
 
1670
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1671
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1671
1672
  else { return run(); }
1672
1673
 
1673
1674
  };
@@ -1700,7 +1701,7 @@ module.exports = function(mongoose, config) {
1700
1701
  return filtered;
1701
1702
  };
1702
1703
 
1703
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1704
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1704
1705
  else { return run(); }
1705
1706
 
1706
1707
  };
@@ -1726,7 +1727,7 @@ module.exports = function(mongoose, config) {
1726
1727
  return result;
1727
1728
  };
1728
1729
 
1729
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1730
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1730
1731
  else { return run(); }
1731
1732
 
1732
1733
  };
@@ -1763,7 +1764,7 @@ module.exports = function(mongoose, config) {
1763
1764
  return filtered;
1764
1765
  };
1765
1766
 
1766
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1767
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1767
1768
  else { return run(); }
1768
1769
 
1769
1770
  };
@@ -1778,7 +1779,7 @@ module.exports = function(mongoose, config) {
1778
1779
  return result;
1779
1780
  };
1780
1781
 
1781
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1782
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1782
1783
  else { return run(); }
1783
1784
 
1784
1785
  };
@@ -1806,7 +1807,7 @@ module.exports = function(mongoose, config) {
1806
1807
  return result;
1807
1808
  };
1808
1809
 
1809
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1810
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1810
1811
  else { return run(); }
1811
1812
 
1812
1813
  };
@@ -1842,7 +1843,7 @@ module.exports = function(mongoose, config) {
1842
1843
  return result;
1843
1844
  };
1844
1845
 
1845
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1846
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1846
1847
  else { return run(); }
1847
1848
 
1848
1849
  };
@@ -1904,7 +1905,7 @@ module.exports = function(mongoose, config) {
1904
1905
  };
1905
1906
  };
1906
1907
 
1907
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1908
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1908
1909
  else { return run(); }
1909
1910
 
1910
1911
  };
@@ -1927,7 +1928,7 @@ module.exports = function(mongoose, config) {
1927
1928
  return result;
1928
1929
  };
1929
1930
 
1930
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1931
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1931
1932
  else { return run(); }
1932
1933
 
1933
1934
  };
@@ -1951,7 +1952,7 @@ module.exports = function(mongoose, config) {
1951
1952
  return result;
1952
1953
  };
1953
1954
 
1954
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1955
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1955
1956
  else { return run(); }
1956
1957
 
1957
1958
  };
@@ -1967,7 +1968,7 @@ module.exports = function(mongoose, config) {
1967
1968
  return result;
1968
1969
  };
1969
1970
 
1970
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1971
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1971
1972
  else { return run(); }
1972
1973
 
1973
1974
  };
@@ -1983,7 +1984,7 @@ module.exports = function(mongoose, config) {
1983
1984
  return result;
1984
1985
  };
1985
1986
 
1986
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1987
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1987
1988
  else { return run(); }
1988
1989
 
1989
1990
  };
@@ -2178,7 +2179,7 @@ module.exports = function(mongoose, config) {
2178
2179
  return orgs;
2179
2180
  };
2180
2181
 
2181
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
2182
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
2182
2183
  else { return run(); }
2183
2184
 
2184
2185
  };
@@ -2265,7 +2266,7 @@ module.exports = function(mongoose, config) {
2265
2266
  return result;
2266
2267
  };
2267
2268
 
2268
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
2269
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
2269
2270
  else { return run(); }
2270
2271
 
2271
2272
  };
@@ -2289,7 +2290,7 @@ module.exports = function(mongoose, config) {
2289
2290
  return await this.findByIdAndUpdate(_id, update, { new: true });
2290
2291
  };
2291
2292
 
2292
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
2293
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
2293
2294
  else { return run(); }
2294
2295
 
2295
2296
  };
package/lib/Person.js CHANGED
@@ -263,7 +263,7 @@ module.exports = function(mongoose, config) {
263
263
  });
264
264
  };
265
265
 
266
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
266
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
267
267
  else { return run(); }
268
268
 
269
269
  };
@@ -278,7 +278,7 @@ module.exports = function(mongoose, config) {
278
278
  return null;
279
279
  };
280
280
 
281
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
281
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
282
282
  else { return run(); }
283
283
 
284
284
  };
@@ -295,7 +295,7 @@ module.exports = function(mongoose, config) {
295
295
  return result;
296
296
  };
297
297
 
298
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
298
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
299
299
  else { return run(); }
300
300
 
301
301
  };
@@ -310,7 +310,7 @@ module.exports = function(mongoose, config) {
310
310
  return result;
311
311
  };
312
312
 
313
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
313
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
314
314
  else { return run(); }
315
315
 
316
316
  };
@@ -323,7 +323,7 @@ module.exports = function(mongoose, config) {
323
323
  return result;
324
324
  };
325
325
 
326
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
326
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
327
327
  else { return run(); }
328
328
 
329
329
  };
@@ -352,7 +352,7 @@ module.exports = function(mongoose, config) {
352
352
  return result;
353
353
  };
354
354
 
355
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
355
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
356
356
  else { return run(); }
357
357
 
358
358
  };
@@ -385,7 +385,7 @@ module.exports = function(mongoose, config) {
385
385
  return result;
386
386
  };
387
387
 
388
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
388
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
389
389
  else { return run(); }
390
390
 
391
391
  };
@@ -423,7 +423,7 @@ module.exports = function(mongoose, config) {
423
423
  return cleanedPerson;
424
424
  };
425
425
 
426
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
426
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
427
427
  else { return run(); }
428
428
 
429
429
  };
@@ -445,7 +445,7 @@ module.exports = function(mongoose, config) {
445
445
  return result;
446
446
  };
447
447
 
448
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
448
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
449
449
  else { return run(); }
450
450
 
451
451
  };
@@ -470,7 +470,7 @@ module.exports = function(mongoose, config) {
470
470
  return cleaned;
471
471
  };
472
472
 
473
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
473
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
474
474
  else { return run(); }
475
475
  };
476
476
 
@@ -484,7 +484,7 @@ module.exports = function(mongoose, config) {
484
484
  return result;
485
485
  };
486
486
 
487
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
487
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
488
488
  else { return run(); }
489
489
 
490
490
  };
@@ -512,7 +512,7 @@ module.exports = function(mongoose, config) {
512
512
  return result;
513
513
  };
514
514
 
515
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
515
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
516
516
  else { return run(); }
517
517
 
518
518
  };
@@ -568,7 +568,7 @@ module.exports = function(mongoose, config) {
568
568
  };
569
569
  };
570
570
 
571
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
571
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
572
572
  else { return run(); }
573
573
  };
574
574
 
@@ -590,7 +590,7 @@ module.exports = function(mongoose, config) {
590
590
  return result;
591
591
  };
592
592
 
593
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
593
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
594
594
  else { return run(); }
595
595
 
596
596
  };
@@ -614,7 +614,7 @@ module.exports = function(mongoose, config) {
614
614
  return result;
615
615
  };
616
616
 
617
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
617
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
618
618
  else { return run(); }
619
619
 
620
620
  };
@@ -951,7 +951,7 @@ module.exports = function(mongoose, config) {
951
951
  }
952
952
  };
953
953
 
954
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
954
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
955
955
  else { return run(); }
956
956
 
957
957
  };
@@ -1037,7 +1037,7 @@ module.exports = function(mongoose, config) {
1037
1037
  return cleaned;
1038
1038
  };
1039
1039
 
1040
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1040
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1041
1041
  else { return run(); }
1042
1042
 
1043
1043
  };
@@ -1056,7 +1056,7 @@ module.exports = function(mongoose, config) {
1056
1056
  return result;
1057
1057
  };
1058
1058
 
1059
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1059
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1060
1060
  else { return run(); }
1061
1061
 
1062
1062
  };
@@ -1079,7 +1079,7 @@ module.exports = function(mongoose, config) {
1079
1079
  return await this.findByIdAndUpdate(_id, update, { new: true });
1080
1080
  };
1081
1081
 
1082
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
1082
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
1083
1083
  else { return run(); }
1084
1084
 
1085
1085
  };
package/lib/Rate.js CHANGED
@@ -30,7 +30,7 @@ module.exports = function(mongoose, config) {
30
30
  return result;
31
31
  };
32
32
 
33
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
33
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
34
34
  else { return run(); }
35
35
 
36
36
  };
@@ -44,7 +44,7 @@ module.exports = function(mongoose, config) {
44
44
  return result;
45
45
  };
46
46
 
47
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
47
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
48
48
  else { return run(); }
49
49
 
50
50
  };
@@ -59,7 +59,7 @@ module.exports = function(mongoose, config) {
59
59
  return await this.findByIdAndUpdate(_id, update, { new: true });
60
60
  };
61
61
 
62
- if (typeof cb === 'function') { run().then(result => cb(null, result)).catch(cb); return; }
62
+ if (typeof cb === 'function') { run().then(result => cb(null, result), err => cb(err)); return; }
63
63
  else { return run(); }
64
64
 
65
65
  };