@dynamatix/cat-shared 0.0.133 → 0.0.136
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.
|
@@ -291,7 +291,7 @@ function applyAuditMiddleware(schema, collectionName) {
|
|
|
291
291
|
console.log("hasChanged", hasChanged);
|
|
292
292
|
if (hasChanged) {
|
|
293
293
|
const newValue = getNestedProperty(update?.$set, field) ?? getNestedProperty(update, field);
|
|
294
|
-
const oldValue = this._originalDoc ? getNestedProperty(this._originalDoc, field) :
|
|
294
|
+
const oldValue = this._originalDoc ? getNestedProperty(this._originalDoc, field) : undefined;
|
|
295
295
|
let lookupOldName;
|
|
296
296
|
let lookupNewName;
|
|
297
297
|
if (field.endsWith('Lid')) {
|
|
@@ -45,7 +45,7 @@ const formfieldSchema = new mongoose.Schema({
|
|
|
45
45
|
dataType: {
|
|
46
46
|
type: String,
|
|
47
47
|
required: true,
|
|
48
|
-
enum: ['text-area', 'counter-input', 'string', 'number', 'boolean-check', 'boolean-radio', 'percentage', 'date', 'array', 'object', 'select', 'radio', 'drop-down', 'sort-code', 'post-code', 'pound', 'lookup', 'multi-select', 'email', 'phone', 'internationalPhone', 'account-number', 'table-text-area'] // Added common form field types
|
|
48
|
+
enum: ['text-area', 'counter-input', 'string', 'number', 'boolean-check', 'boolean-radio', 'percentage', 'date', 'array', 'object', 'select', 'radio', 'drop-down', 'sort-code', 'post-code', 'pound', 'lookup', 'multi-select', 'email', 'phone', 'internationalPhone', 'account-number', 'table-text-area', 'date-only'] // Added common form field types
|
|
49
49
|
},
|
|
50
50
|
isRequired: {
|
|
51
51
|
type: Boolean,
|
|
@@ -49,6 +49,7 @@ propertyMetadataSchema.index({ collectionName: 1, propertyName: 1 }, { unique: t
|
|
|
49
49
|
propertyMetadataSchema.index({ collectionName: 1, isActive: 1 });
|
|
50
50
|
propertyMetadataSchema.index({ type: 1, isActive: 1 });
|
|
51
51
|
propertyMetadataSchema.index({ category: 1, isActive: 1 });
|
|
52
|
+
propertyMetadataSchema.index({ createdAt: 1 });
|
|
52
53
|
|
|
53
54
|
// Apply audit middleware
|
|
54
55
|
applyAuditMiddleware(propertyMetadataSchema, "PropertyMetaData");
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamatix/cat-shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.136",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
+
"patch": "npm version patch && npm publish --access public && exit 0"
|
|
7
8
|
},
|
|
8
9
|
"author": "",
|
|
9
10
|
"license": "ISC",
|