diff --git a/app/imports/api/properties/Actions.js b/app/imports/api/properties/Actions.js index 8f8007d3..caa3c51e 100644 --- a/app/imports/api/properties/Actions.js +++ b/app/imports/api/properties/Actions.js @@ -175,7 +175,7 @@ const ComputedOnlyActionSchema = createPropertySchema({ 'resources.itemsConsumed.$.itemColor': { type: String, optional: true, - max: STORAGE_LIMITS.color, + regEx: /^#([a-f0-9]{3}){1,2}\b$/i, removeBeforeCompute: true, }, 'resources.attributesConsumed': { diff --git a/app/imports/api/properties/subSchemas/ItemConsumedSchema.js b/app/imports/api/properties/subSchemas/ItemConsumedSchema.js index 1bf08904..2290649d 100644 --- a/app/imports/api/properties/subSchemas/ItemConsumedSchema.js +++ b/app/imports/api/properties/subSchemas/ItemConsumedSchema.js @@ -49,7 +49,7 @@ const ComputedOnlyItemConsumedSchema = new SimpleSchema({ itemColor: { type: String, optional: true, - max: STORAGE_LIMITS.color, + regEx: /^#([a-f0-9]{3}){1,2}\b$/i, }, }); diff --git a/app/imports/constants/STORAGE_LIMITS.js b/app/imports/constants/STORAGE_LIMITS.js index 11cc55d0..f2bd1e1f 100644 --- a/app/imports/constants/STORAGE_LIMITS.js +++ b/app/imports/constants/STORAGE_LIMITS.js @@ -2,7 +2,6 @@ const STORAGE_LIMITS = Object.freeze({ // String lengths calculation: 1024, collectionName: 64, - color: 10000, description: 49473, //the length of the Bee Movie script inlineCalculationField: 49473, errorMessage: 256,