@dhyasama/totem-models 8.17.0 → 8.19.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/Financials.js +4 -4
- package/lib/Organization.js +2 -2
- package/package.json +1 -1
package/lib/Financials.js
CHANGED
|
@@ -218,7 +218,7 @@ module.exports = function(mongoose, config) {
|
|
|
218
218
|
});
|
|
219
219
|
|
|
220
220
|
query.populate('organization', 'name logoUrl');
|
|
221
|
-
query.populate('customer'
|
|
221
|
+
query.populate('customer');
|
|
222
222
|
|
|
223
223
|
query.exec(function (err, result) {
|
|
224
224
|
|
|
@@ -232,16 +232,16 @@ module.exports = function(mongoose, config) {
|
|
|
232
232
|
return cb(null, null);
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
let customerId = result.customer._id;
|
|
236
|
-
|
|
237
235
|
_.each(result.snapshots, function (snapshot) {
|
|
238
236
|
|
|
239
237
|
snapshot.documents = _.filter(snapshot.documents, function (document) {
|
|
240
|
-
return document.customer
|
|
238
|
+
return document.customer == result.customer._id;
|
|
241
239
|
});
|
|
242
240
|
|
|
243
241
|
});
|
|
244
242
|
|
|
243
|
+
return cb(null, result);
|
|
244
|
+
|
|
245
245
|
});
|
|
246
246
|
|
|
247
247
|
};
|
package/lib/Organization.js
CHANGED
|
@@ -229,12 +229,12 @@ module.exports = function(mongoose, config) {
|
|
|
229
229
|
name: { type: String, trim: true },
|
|
230
230
|
description: { type: String, trim: true },
|
|
231
231
|
format: { type: String, enum: [null, 'number', 'money', 'percentage', 'variance']},
|
|
232
|
-
required: { type: Boolean, default: false }
|
|
232
|
+
required: { type: Boolean, default: false }
|
|
233
233
|
}],
|
|
234
234
|
questions: [{
|
|
235
235
|
_id: false,
|
|
236
236
|
prompt: { type: String, trim: true },
|
|
237
|
-
required: { type: Boolean, default: false }
|
|
237
|
+
required: { type: Boolean, default: false }
|
|
238
238
|
}]
|
|
239
239
|
},
|
|
240
240
|
|