mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
Stricter models typing
This commit is contained in:
parent
9a320a06b6
commit
16c016e8b1
54 changed files with 148 additions and 95 deletions
|
@ -31,6 +31,7 @@ import {
|
|||
MUserWithNotificationSetting,
|
||||
MVideoWithRights
|
||||
} from '@server/types/models'
|
||||
import { AttributesOnly } from '@shared/core-utils'
|
||||
import { hasUserRight, USER_ROLE_LABELS } from '../../../shared/core-utils/users'
|
||||
import { AbuseState, MyUser, UserRight, VideoPlaylistType, VideoPrivacy } from '../../../shared/models'
|
||||
import { User, UserRole } from '../../../shared/models/users'
|
||||
|
@ -233,7 +234,7 @@ enum ScopeNames {
|
|||
}
|
||||
]
|
||||
})
|
||||
export class UserModel extends Model {
|
||||
export class UserModel extends Model<Partial<AttributesOnly<UserModel>>> {
|
||||
|
||||
@AllowNull(true)
|
||||
@Is('UserPassword', value => throwIfNotValid(value, isUserPasswordValid, 'user password', true))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue