@dynamatix/cat-shared 0.0.15 → 0.0.16

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.
@@ -1,10 +1,14 @@
1
+ import AuditConfigModel from '../models/audit-config.model.js';
2
+ import AuditLog from '../models/audit.model.js';
3
+ import { getContext } from '../services/request-context.service.js';
4
+
1
5
 
2
6
  let onAuditLogCreated = null;
3
7
 
4
8
  function applyAuditMiddleware(schema, collectionName) {
5
9
  // Handle create
6
10
  schema.post('save', async function (doc) {
7
- const auditConfig = await AuditConfigModel.findOne({ collectionName });
11
+ const auditConfig = await AuditLog.findOne({ collectionName });
8
12
  if (!auditConfig?.trackCreation) return;
9
13
 
10
14
  const context = getContext();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/cat-shared",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"