@dhyasama/totem-models 10.20.0 → 10.21.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/Fund.js CHANGED
@@ -162,14 +162,6 @@ module.exports = function(mongoose, config) {
162
162
  }
163
163
  }
164
164
  ],
165
- must: [
166
- {
167
- equals: {
168
- path: 'customer',
169
- value: mongoose.Types.ObjectId(options.CUSTOMER_ID)
170
- }
171
- }
172
- ],
173
165
  minimumShouldMatch: 1
174
166
  }
175
167
  }
@@ -183,17 +175,7 @@ module.exports = function(mongoose, config) {
183
175
  score: { $meta: "searchScore" }
184
176
  }
185
177
  }
186
- ]).exec(function(err, orgs) {
187
-
188
- if (err) { return cb(err, null); }
189
-
190
- orgs = _.map(orgs, function(org) {
191
- return helpers.cleanOrg(org, options.CUSTOMER_ID);
192
- });
193
-
194
- return cb(null, orgs);
195
-
196
- });
178
+ ]).exec(cb);
197
179
 
198
180
  };
199
181
 
@@ -867,17 +867,7 @@ module.exports = function(mongoose, config) {
867
867
  score: { $meta: "searchScore" }
868
868
  }
869
869
  }
870
- ]).exec(function(err, orgs) {
871
-
872
- if (err) { return cb(err, null); }
873
-
874
- orgs = _.map(orgs, function(org) {
875
- return helpers.cleanOrg(org, options.CUSTOMER_ID);
876
- });
877
-
878
- return cb(null, orgs);
879
-
880
- });
870
+ ]).exec(cb);
881
871
 
882
872
  };
883
873
 
package/lib/Person.js CHANGED
@@ -1059,7 +1059,17 @@ module.exports = function(mongoose, config) {
1059
1059
  "score": { "$meta": "searchScore" }
1060
1060
  }
1061
1061
  }
1062
- ], cb);
1062
+ ]).exec(function(err, people) {
1063
+
1064
+ if (err) { return cb(err, null); }
1065
+
1066
+ people = _.map(people, function(person) {
1067
+ return helpers.cleanPerson(person, options.CUSTOMER_ID);
1068
+ });
1069
+
1070
+ return cb(null, people);
1071
+
1072
+ });
1063
1073
 
1064
1074
  };
1065
1075
 
package/lib/Webhook.js CHANGED
@@ -27,4 +27,4 @@ module.exports = function(mongoose, config) {
27
27
 
28
28
  mongoose.model('Webhook', Webhook);
29
29
 
30
- };
30
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "10.20.0",
3
+ "version": "10.21.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",