Added reasonable storage limits to most string and array schemas

This commit is contained in:
Stefan Zermatten
2021-08-10 18:12:55 +02:00
parent 4c2155d8ff
commit e21586e9ce
45 changed files with 245 additions and 204 deletions

View File

@@ -1,18 +1,22 @@
import SimpleSchema from 'simpl-schema';
import InlineComputationSchema from '/imports/api/properties/subSchemas/InlineComputationSchema.js';
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js';
let NoteSchema = new SimpleSchema({
name: {
type: String,
optional: true,
max: STORAGE_LIMITS.name,
},
summary: {
type: String,
optional: true,
max: STORAGE_LIMITS.summary,
},
description: {
type: String,
optional: true,
max: STORAGE_LIMITS.description,
},
});
@@ -21,14 +25,14 @@ let ComputedOnlyNoteSchema = new SimpleSchema({
summaryCalculations: {
type: Array,
defaultValue: [],
maxCount: 32,
maxCount: STORAGE_LIMITS.inlineCalculationCount,
},
'summaryCalculations.$': InlineComputationSchema,
descriptionCalculations: {
type: Array,
defaultValue: [],
maxCount: 32,
maxCount: STORAGE_LIMITS.inlineCalculationCount,
},
'descriptionCalculations.$': InlineComputationSchema,