@dynamatix/cat-shared 0.0.77 → 0.0.79

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) {
@@ -59,6 +59,10 @@ const formfieldSchema = new mongoose.Schema({
59
59
  type: Boolean,
60
60
  default: false
61
61
  },
62
+ isShowClearIcon: {
63
+ type: Boolean,
64
+ default: true
65
+ },
62
66
  requiredErrorMessage: {
63
67
  type: String,
64
68
  default: 'Field is required'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/cat-shared",
3
- "version": "0.0.77",
3
+ "version": "0.0.79",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"