fix: Cannot duplicate document with title close to max title length
closes #1610
This commit is contained in:
@@ -5,6 +5,7 @@ import randomstring from "randomstring";
|
||||
import Sequelize, { Transaction } from "sequelize";
|
||||
import MarkdownSerializer from "slate-md-serializer";
|
||||
import isUUID from "validator/lib/isUUID";
|
||||
import { MAX_TITLE_LENGTH } from "../../shared/constants";
|
||||
import parseTitle from "../../shared/utils/parseTitle";
|
||||
import unescape from "../../shared/utils/unescape";
|
||||
import { Collection, User } from "../models";
|
||||
@@ -90,8 +91,8 @@ const Document = sequelize.define(
|
||||
type: DataTypes.STRING,
|
||||
validate: {
|
||||
len: {
|
||||
args: [0, 100],
|
||||
msg: "Document title must be less than 100 characters",
|
||||
args: [0, MAX_TITLE_LENGTH],
|
||||
msg: `Document title must be less than ${MAX_TITLE_LENGTH} characters`,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user