aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-share.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-05-12 14:09:04 +0200
committerChocobozzz <me@florianbigard.com>2021-05-12 14:12:14 +0200
commit16c016e8b1d5ca46343d3363f9a49e24c5d7c944 (patch)
tree157dfa22ac95bd76a411aaf78e4df17152530e1c /server/models/video/video-share.ts
parent9a320a06b663a2e02c3156a07135f75f9e987b11 (diff)
downloadPeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.tar.gz
PeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.tar.zst
PeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.zip
Stricter models typing
Diffstat (limited to 'server/models/video/video-share.ts')
-rw-r--r--server/models/video/video-share.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/models/video/video-share.ts b/server/models/video/video-share.ts
index 99a24dbdf..505c305e2 100644
--- a/server/models/video/video-share.ts
+++ b/server/models/video/video-share.ts
@@ -1,5 +1,6 @@
1import { literal, Op, QueryTypes, Transaction } from 'sequelize' 1import { literal, Op, QueryTypes, Transaction } from 'sequelize'
2import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' 2import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Is, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'
3import { AttributesOnly } from '@shared/core-utils'
3import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' 4import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
4import { CONSTRAINTS_FIELDS } from '../../initializers/constants' 5import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
5import { MActorDefault } from '../../types/models' 6import { MActorDefault } from '../../types/models'
@@ -50,7 +51,7 @@ enum ScopeNames {
50 } 51 }
51 ] 52 ]
52}) 53})
53export class VideoShareModel extends Model { 54export class VideoShareModel extends Model<Partial<AttributesOnly<VideoShareModel>>> {
54 55
55 @AllowNull(false) 56 @AllowNull(false)
56 @Is('VideoShareUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'url')) 57 @Is('VideoShareUrl', value => throwIfNotValid(value, isActivityPubUrlValid, 'url'))