@dhyasama/totem-models 7.28.1 → 7.29.1

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/Document.js CHANGED
@@ -127,10 +127,14 @@ module.exports = function(mongoose, config) {
127
127
  };
128
128
 
129
129
  Document.statics.getById = function (id, cb) {
130
- this.findOne({
130
+
131
+ var self = this;
132
+
133
+ self.findOne({
131
134
  '_id': id,
132
135
  'customer': config.CUSTOMER_ID
133
136
  }).exec(cb);
137
+
134
138
  };
135
139
 
136
140
  Document.statics.modifyById = function(id, update, cb) {
package/lib/Sync.js CHANGED
@@ -10,7 +10,6 @@ module.exports = function(mongoose, config) {
10
10
 
11
11
  var Sync = new Schema({
12
12
  customer: { type: String, required: true },
13
- uuid: { type: String, required: true },
14
13
  syncedOn: { type: Date, required: true },
15
14
  syncedBy: { type: String, trim: true },
16
15
  issues: [{
@@ -19,21 +18,19 @@ module.exports = function(mongoose, config) {
19
18
  }]
20
19
  });
21
20
 
22
- Sync.statics.getByUUID = function getByUUID(customerId, uuid, cb) {
21
+ Sync.statics.getById = function (id, customerId, cb) {
23
22
 
24
23
  var self = this;
25
24
 
26
- var query = self.findOne({
27
- 'customer': customerId,
28
- 'uuid': uuid
29
- });
30
-
31
- query.exec(cb);
25
+ self.findOne({
26
+ '_id': id,
27
+ 'customer': customerId
28
+ }).exec(cb);
32
29
 
33
30
  };
34
31
 
35
32
  Sync.statics.upsert = function(sync, cb) {
36
- sync.createdOn = new Date();
33
+ sync.syncedOn = new Date();
37
34
  sync.save(cb);
38
35
  };
39
36
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "7.28.1",
3
+ "version": "7.29.1",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",