diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-12 14:09:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-12 14:12:14 +0200 |
commit | 16c016e8b1d5ca46343d3363f9a49e24c5d7c944 (patch) | |
tree | 157dfa22ac95bd76a411aaf78e4df17152530e1c /server/models/user/user.ts | |
parent | 9a320a06b663a2e02c3156a07135f75f9e987b11 (diff) | |
download | PeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.tar.gz PeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.tar.zst PeerTube-16c016e8b1d5ca46343d3363f9a49e24c5d7c944.zip |
Stricter models typing
Diffstat (limited to 'server/models/user/user.ts')
-rw-r--r-- | server/models/user/user.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/models/user/user.ts b/server/models/user/user.ts index 8d2564e54..20696b1f4 100644 --- a/server/models/user/user.ts +++ b/server/models/user/user.ts | |||
@@ -31,6 +31,7 @@ import { | |||
31 | MUserWithNotificationSetting, | 31 | MUserWithNotificationSetting, |
32 | MVideoWithRights | 32 | MVideoWithRights |
33 | } from '@server/types/models' | 33 | } from '@server/types/models' |
34 | import { AttributesOnly } from '@shared/core-utils' | ||
34 | import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users' | 35 | import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users' |
35 | import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models' | 36 | import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models' |
36 | import { User, UserRole } from '../../../shared/models/users' | 37 | import { User, UserRole } from '../../../shared/models/users' |
@@ -233,7 +234,7 @@ enum ScopeNames { | |||
233 | } | 234 | } |
234 | ] | 235 | ] |
235 | }) | 236 | }) |
236 | export class UserModel extends Model { | 237 | export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> { |
237 | 238 | ||
238 | @AllowNull(true) | 239 | @AllowNull(true) |
239 | @Is('UserPassword', value => throwIfNotValid(value, isUserPasswordValid, 'user password', true)) | 240 | @Is('UserPassword', value => throwIfNotValid(value, isUserPasswordValid, 'user password', true)) |