X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-share.ts;h=505c305e234826f4ce97da7a2e5d69267aa0e68d;hb=597f771f3f2bfe4b1e7234a5760e23f0283e2b29;hp=5059c1fa69cb55893117b7f1b89075d0771b1d7b;hpb=74d249bc1346c7cfaac7ee49bebbebcf2a01f82a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-share.ts b/server/models/video/video-share.ts index 5059c1fa6..505c305e2 100644 --- a/server/models/video/video-share.ts +++ b/server/models/video/video-share.ts @@ -1,10 +1,11 @@ import { literal, Op, QueryTypes, Transaction } from 'sequelize' import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' +import { AttributesOnly } from '@shared/core-utils' import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' import { CONSTRAINTS_FIELDS } from '../../initializers/constants' import { MActorDefault } from '../../types/models' import { MVideoShareActor, MVideoShareFull } from '../../types/models/video' -import { ActorModel } from '../activitypub/actor' +import { ActorModel } from '../actor/actor' import { buildLocalActorIdsIn, throwIfNotValid } from '../utils' import { VideoModel } from './video' @@ -50,7 +51,7 @@ enum ScopeNames { } ] }) -export class VideoShareModel extends Model { +export class VideoShareModel extends Model>> { @AllowNull(false) @Is('VideoShareUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'url'))