@dynamatix/cat-shared 0.0.96 → 0.0.98

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.
@@ -47,6 +47,8 @@ async function resolveDescription(field, doc) {
47
47
  }
48
48
  case 'direct':
49
49
  return doc[config.descriptionField] || '';
50
+ case 'displayFieldReturn': // For case we just want to show display field value directly
51
+ return config.displayField || '';
50
52
  case 'composite':
51
53
  return (config.descriptionFields || [])
52
54
  .map(f => doc[f])
@@ -184,15 +186,15 @@ function applyAuditMiddleware(schema, collectionName) {
184
186
  if (field.endsWith('Lid')) {
185
187
  const newlookupDoc = await mongoose.models['Lookup'].findById(newValue).lean();
186
188
  if (newlookupDoc) {
187
- lookupOldName = newlookupDoc.name;
189
+ lookupNewName = newlookupDoc.name;
188
190
  } else {
189
- lookupOldName = '';
191
+ lookupNewName = '';
190
192
  }
191
193
  const oldlookupDoc = await mongoose.models['Lookup'].findById(oldValue).lean();
192
194
  if (oldlookupDoc) {
193
- lookupNewName = oldlookupDoc.name;
195
+ lookupOldName = oldlookupDoc.name;
194
196
  } else {
195
- lookupNewName = '';
197
+ lookupOldName = '';
196
198
  }
197
199
  }
198
200
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/cat-shared",
3
- "version": "0.0.96",
3
+ "version": "0.0.98",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"