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-notification-setting.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-notification-setting.ts')
-rw-r--r-- | server/models/user/user-notification-setting.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/models/user/user-notification-setting.ts b/server/models/user/user-notification-setting.ts index 138051528..bee7d7851 100644 --- a/server/models/user/user-notification-setting.ts +++ b/server/models/user/user-notification-setting.ts | |||
@@ -14,6 +14,7 @@ import { | |||
14 | } from 'sequelize-typescript' | 14 | } from 'sequelize-typescript' |
15 | import { TokensCache } from '@server/lib/auth/tokens-cache' | 15 | import { TokensCache } from '@server/lib/auth/tokens-cache' |
16 | import { MNotificationSettingFormattable } from '@server/types/models' | 16 | import { MNotificationSettingFormattable } from '@server/types/models' |
17 | import { AttributesOnly } from '@shared/core-utils' | ||
17 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' | 18 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' |
18 | import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' | 19 | import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' |
19 | import { throwIfNotValid } from '../utils' | 20 | import { throwIfNotValid } from '../utils' |
@@ -28,7 +29,7 @@ import { UserModel } from './user' | |||
28 | } | 29 | } |
29 | ] | 30 | ] |
30 | }) | 31 | }) |
31 | export class UserNotificationSettingModel extends Model { | 32 | export class UserNotificationSettingModel extends Model<Partial<AttributesOnly<UserNotificationSettingModel>>> { |
32 | 33 | ||
33 | @AllowNull(false) | 34 | @AllowNull(false) |
34 | @Default(null) | 35 | @Default(null) |