@dhyasama/totem-models 11.10.0 → 11.11.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.
Files changed (2) hide show
  1. package/lib/Folder.js +2 -13
  2. package/package.json +1 -1
package/lib/Folder.js CHANGED
@@ -50,23 +50,12 @@ module.exports = function(mongoose, config) {
50
50
 
51
51
  const self = this;
52
52
 
53
- const populateFolders = async (folders) => {
54
- for (const folder of folders) {
55
- const childFolders = await self.find({ parent: folder._id });
56
- folder.children = await populateFolders(childFolders);
57
- }
58
- return folders;
59
- };
60
-
61
53
  self.find({
62
54
  'entity.id': entity.id,
63
55
  'entity.model': entity.model,
64
- customer: options.CUSTOMER_ID,
65
- parent: null
56
+ customer: options.CUSTOMER_ID
66
57
  })
67
- .then(populateFolders)
68
- .then(folders => cb(null, folders))
69
- .catch(err => cb(err));
58
+ .exec(cb);
70
59
 
71
60
  };
72
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "11.10.0",
3
+ "version": "11.11.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",