@dynamatix/cat-shared 0.0.76 → 0.0.78

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.
@@ -123,11 +123,14 @@ function applyAuditMiddleware(schema, collectionName) {
123
123
  }
124
124
 
125
125
  async function updateContextAuditCount(contextId, count) {
126
- if(!contextId) return;
126
+ count = Number(count);
127
+ if (!contextId || isNaN(count)) return;
127
128
  const model = mongoose.models['Application'];
128
- const context = await model.findById(contextId);
129
- context.newAuditRecordsCount = Number(context.newAuditRecordsCount || 0) + Number(count ? count : 1);
130
- await context.save();
129
+ await model.findByIdAndUpdate(
130
+ { _id: contextId },
131
+ { $inc: { newAuditRecordsCount: count } },
132
+ { new: true, upsert: true }
133
+ );
131
134
  }
132
135
 
133
136
  export function registerAuditHook(callback) {
@@ -79,6 +79,14 @@ const formfieldSchema = new mongoose.Schema({
79
79
  type: String,
80
80
  default: null
81
81
  },
82
+ keyIconClass: {
83
+ type: String,
84
+ default: null
85
+ },
86
+ keyIconStyle: {
87
+ type: Object,
88
+ default: null
89
+ },
82
90
  // Ex: sort-code, post-code, pound, drop-down, lookup
83
91
  uiHint: {
84
92
  type: String
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/cat-shared",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"