fix: Add missing validation to document state
This commit is contained in:
@@ -228,6 +228,10 @@ class Document extends ParanoidModel {
|
|||||||
@Column(DataType.TEXT)
|
@Column(DataType.TEXT)
|
||||||
text: string;
|
text: string;
|
||||||
|
|
||||||
|
@Length({
|
||||||
|
max: DocumentValidation.maxStateLength,
|
||||||
|
msg: `Document collaborative state is too large, you must create a new document`,
|
||||||
|
})
|
||||||
@Column(DataType.BLOB)
|
@Column(DataType.BLOB)
|
||||||
state: Uint8Array;
|
state: Uint8Array;
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ export const CollectionValidation = {
|
|||||||
export const DocumentValidation = {
|
export const DocumentValidation = {
|
||||||
/** The maximum length of the document title */
|
/** The maximum length of the document title */
|
||||||
maxTitleLength: 100,
|
maxTitleLength: 100,
|
||||||
|
|
||||||
|
/** The maximum size of the collaborative document state */
|
||||||
|
maxStateLength: 1000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const PinValidation = {
|
export const PinValidation = {
|
||||||
|
|||||||
Reference in New Issue
Block a user