add validation to whatsapp name

This commit is contained in:
canove
2020-09-19 09:59:10 -03:00
parent d3e0d1230f
commit 872e237b48
3 changed files with 22 additions and 6 deletions

View File

@@ -9,7 +9,8 @@ import {
AutoIncrement,
Default,
AllowNull,
HasMany
HasMany,
Unique
} from "sequelize-typescript";
import Ticket from "./Ticket";
@@ -20,6 +21,8 @@ class Whatsapp extends Model<Whatsapp> {
@Column
id: number;
@AllowNull
@Unique
@Column(DataType.TEXT)
name: string;