Refactor validations

This commit is contained in:
Tom Moor
2022-07-24 13:40:04 +01:00
parent 870d9ed41e
commit ec35af4bc5
13 changed files with 47 additions and 33 deletions

View File

@@ -3,7 +3,7 @@ import { observable } from "mobx";
import { observer } from "mobx-react";
import * as React from "react";
import { withTranslation, Trans, WithTranslation } from "react-i18next";
import { MAX_TITLE_LENGTH } from "@shared/constants";
import { CollectionValidation } from "@shared/validations";
import RootStore from "~/stores/RootStore";
import Collection from "~/models/Collection";
import Button from "~/components/Button";
@@ -128,7 +128,7 @@ class CollectionNew extends React.Component<Props> {
type="text"
label={t("Name")}
onChange={this.handleNameChange}
maxLength={MAX_TITLE_LENGTH}
maxLength={CollectionValidation.maxNameLength}
value={this.name}
required
autoFocus