X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Ftag.ts;h=c1eebe27f2950f27779ea225c9afd7ee77dabe59;hb=efa3fef23ecf4e1c5289f8715de184c272ea49f7;hp=d04205703b7a12b1121a38e571b09cfebc9f6504;hpb=b49f22d8f9a52ab75fd38db2d377249eb58fa678;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/tag.ts b/server/models/video/tag.ts index d04205703..c1eebe27f 100644 --- a/server/models/video/tag.ts +++ b/server/models/video/tag.ts @@ -1,6 +1,7 @@ import { col, fn, QueryTypes, Transaction } from 'sequelize' import { AllowNull, BelongsToMany, Column, CreatedAt, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' import { MTag } from '@server/types/models' +import { AttributesOnly } from '@shared/core-utils' import { VideoPrivacy, VideoState } from '../../../shared/models/videos' import { isVideoTagValid } from '../../helpers/custom-validators/videos' import { throwIfNotValid } from '../utils' @@ -21,7 +22,7 @@ import { VideoTagModel } from './video-tag' } ] }) -export class TagModel extends Model { +export class TagModel extends Model>> { @AllowNull(false) @Is('VideoTag', value => throwIfNotValid(value, isVideoTagValid, 'tag'))