@dynamatix/cat-shared 0.0.71 → 0.0.72
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.
|
@@ -29,8 +29,8 @@ async function resolveExternalData(descriptionResolutorForExternalData, recordId
|
|
|
29
29
|
const map = await ValueReferenceMap.findOne({ field: descriptionResolutorForExternalData });
|
|
30
30
|
const Model = mongoose.models[map.model];
|
|
31
31
|
if (!Model) return "";
|
|
32
|
-
const doc = Model.findById(recordId).lean()
|
|
33
|
-
return doc[
|
|
32
|
+
const doc = await Model.findById(recordId).lean()
|
|
33
|
+
return doc[map.displayField];
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function applyAuditMiddleware(schema, collectionName) {
|
|
@@ -52,7 +52,7 @@ function applyAuditMiddleware(schema, collectionName) {
|
|
|
52
52
|
contextId
|
|
53
53
|
};
|
|
54
54
|
if (auditConfig.descriptionResolutorForExternalData) {
|
|
55
|
-
log.externalData.description = resolveExternalData(auditConfig.descriptionResolutorForExternalData, doc[descriptionResolutorForExternalData])
|
|
55
|
+
log.externalData.description = await resolveExternalData(auditConfig.descriptionResolutorForExternalData, doc[descriptionResolutorForExternalData])
|
|
56
56
|
}
|
|
57
57
|
await AuditLog.create(log);
|
|
58
58
|
|
|
@@ -95,7 +95,7 @@ function applyAuditMiddleware(schema, collectionName) {
|
|
|
95
95
|
|
|
96
96
|
let externalData={};
|
|
97
97
|
if (auditConfig.descriptionResolutorForExternalData) {
|
|
98
|
-
externalData.description = resolveExternalData(auditConfig.descriptionResolutorForExternalData,
|
|
98
|
+
externalData.description = await resolveExternalData(auditConfig.descriptionResolutorForExternalData, result[auditConfig.descriptionResolutorForExternalData])
|
|
99
99
|
}
|
|
100
100
|
logs.push({
|
|
101
101
|
name: `${collectionName}.${field}`,
|