@dhyasama/totem-models 6.16.4 → 6.17.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/.npmignore +14 -0
- package/lib/Organization.js +17 -0
- package/package-lock.json +1829 -0
- package/package.json +1 -1
package/.npmignore
ADDED
package/lib/Organization.js
CHANGED
|
@@ -1278,6 +1278,23 @@ module.exports = function(mongoose, config) {
|
|
|
1278
1278
|
this.find({ 'slug': { $in : slugs } }).exec(cb);
|
|
1279
1279
|
};
|
|
1280
1280
|
|
|
1281
|
+
Organization.statics.findBySocial = function findBySocial(handle, cb) {
|
|
1282
|
+
|
|
1283
|
+
var self = this;
|
|
1284
|
+
|
|
1285
|
+
self
|
|
1286
|
+
.find({ $or:
|
|
1287
|
+
[
|
|
1288
|
+
{ 'social.facebook': handle },
|
|
1289
|
+
{ 'social.linkedin': handle },
|
|
1290
|
+
{ 'social.twitter': handle }
|
|
1291
|
+
],
|
|
1292
|
+
'deleted': { $ne: true }
|
|
1293
|
+
})
|
|
1294
|
+
.exec(cb);
|
|
1295
|
+
|
|
1296
|
+
};
|
|
1297
|
+
|
|
1281
1298
|
Organization.statics.findDupes = function findDupes(org, options, cb) {
|
|
1282
1299
|
|
|
1283
1300
|
if (!cb) throw new Error('cb is required');
|