@dhyasama/totem-models 6.19.1 → 6.20.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/Deal.js +6 -0
- package/lib/Organization.js +6 -3
- package/package.json +1 -1
package/lib/Deal.js
CHANGED
|
@@ -159,6 +159,12 @@ module.exports = function(mongoose, config) {
|
|
|
159
159
|
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
+
Deal.statics.getByIds = function (ids, cb) {
|
|
163
|
+
this
|
|
164
|
+
.find({customer: config.CUSTOMER_ID, '_id': { $in : ids } })
|
|
165
|
+
.exec(cb);
|
|
166
|
+
};
|
|
167
|
+
|
|
162
168
|
// Get all deals belonging to a customer
|
|
163
169
|
Deal.statics.getForCustomer = function (customerId, options, cb) {
|
|
164
170
|
|
package/lib/Organization.js
CHANGED
|
@@ -1312,6 +1312,7 @@ module.exports = function(mongoose, config) {
|
|
|
1312
1312
|
|
|
1313
1313
|
if (result.indexOf('/') === 0) { result = result.replace('/', ''); }
|
|
1314
1314
|
if (result.indexOf('in/') === 0) { result = result.replace('in/', ''); }
|
|
1315
|
+
if (result.indexOf('organization/') === 0) { result = result.replace('organization/', ''); }
|
|
1315
1316
|
if (result.indexOf('/') >= 0) { result = result.split('/')[0]; }
|
|
1316
1317
|
|
|
1317
1318
|
console.log(val, '-->', result);
|
|
@@ -1322,8 +1323,9 @@ module.exports = function(mongoose, config) {
|
|
|
1322
1323
|
|
|
1323
1324
|
var domains = {
|
|
1324
1325
|
facebook: 'https://facebook.com',
|
|
1325
|
-
linkedin: 'https://linkedin.com',
|
|
1326
|
-
twitter: 'https://twitter.com'
|
|
1326
|
+
linkedin: 'https://linkedin.com/company',
|
|
1327
|
+
twitter: 'https://twitter.com',
|
|
1328
|
+
crunchbase: 'https://crunchbase.com/organization'
|
|
1327
1329
|
};
|
|
1328
1330
|
|
|
1329
1331
|
var username = getUsername(value);
|
|
@@ -1344,7 +1346,8 @@ module.exports = function(mongoose, config) {
|
|
|
1344
1346
|
[
|
|
1345
1347
|
{ 'social.facebook': domains.facebook + '/' + username },
|
|
1346
1348
|
{ 'social.linkedin': domains.linkedin + '/in/' + username },
|
|
1347
|
-
{ 'social.twitter': domains.twitter + '/' + username }
|
|
1349
|
+
{ 'social.twitter': domains.twitter + '/' + username },
|
|
1350
|
+
{ 'crunchbase.url': domains.crunchbase + '/' + username }
|
|
1348
1351
|
],
|
|
1349
1352
|
'deleted': { $ne: true }
|
|
1350
1353
|
})
|