fix: Add additional model validation (#3725)

This commit is contained in:
Tom Moor
2022-07-02 23:29:01 +02:00
committed by GitHub
parent 0c30d2bb34
commit 8ebe4b27b1
9 changed files with 43 additions and 5 deletions

View File

@@ -11,6 +11,7 @@ import Team from "./Team";
import User from "./User";
import IdModel from "./base/IdModel";
import Fix from "./decorators/Fix";
import Length from "./validators/Length";
@Table({ tableName: "team_domains", modelName: "team_domain" })
@Fix
@@ -20,6 +21,7 @@ class TeamDomain extends IdModel {
msg: "You chose a restricted domain, please try another.",
})
@NotEmpty
@Length({ min: 0, max: 255, msg: "Must be less than 255 characters" })
@Column
name: string;