Refactor validations
This commit is contained in:
@@ -21,7 +21,6 @@ import {
|
||||
Length as SimpleLength,
|
||||
} from "sequelize-typescript";
|
||||
import isUUID from "validator/lib/isUUID";
|
||||
import { MAX_TITLE_LENGTH } from "@shared/constants";
|
||||
import { sortNavigationNodes } from "@shared/utils/collections";
|
||||
import { SLUG_URL_REGEX } from "@shared/utils/urlHelpers";
|
||||
import { CollectionValidation } from "@shared/validations";
|
||||
@@ -144,8 +143,8 @@ class Collection extends ParanoidModel {
|
||||
|
||||
@NotContainsUrl
|
||||
@Length({
|
||||
max: MAX_TITLE_LENGTH,
|
||||
msg: `name must be ${MAX_TITLE_LENGTH} characters or less`,
|
||||
max: CollectionValidation.maxNameLength,
|
||||
msg: `name must be ${CollectionValidation.maxNameLength} characters or less`,
|
||||
})
|
||||
@Column
|
||||
name: string;
|
||||
|
||||
Reference in New Issue
Block a user