X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fuser%2Fuser-notification-setting.ts;h=66e1d85b31fe10476e0d511f2b677144b4bc8fa9;hb=77239b425a8e00822a53c9907415832a473c3eb6;hp=138051528d6f493da896a79773d37294f56c2093;hpb=7d9ba5c08999c6482f0bc5e0c09c6f55b7724090;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/user/user-notification-setting.ts b/server/models/user/user-notification-setting.ts index 138051528..66e1d85b3 100644 --- a/server/models/user/user-notification-setting.ts +++ b/server/models/user/user-notification-setting.ts @@ -14,6 +14,7 @@ import { } from 'sequelize-typescript' import { TokensCache } from '@server/lib/auth/tokens-cache' import { MNotificationSettingFormattable } from '@server/types/models' +import { AttributesOnly } from '@shared/typescript-utils' import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' import { throwIfNotValid } from '../utils' @@ -28,7 +29,7 @@ import { UserModel } from './user' } ] }) -export class UserNotificationSettingModel extends Model { +export class UserNotificationSettingModel extends Model>> { @AllowNull(false) @Default(null) @@ -174,6 +175,15 @@ export class UserNotificationSettingModel extends Model { @Column newPluginVersion: UserNotificationSettingValue + @AllowNull(false) + @Default(null) + @Is( + 'UserNotificationSettingMyVideoStudioEditionFinished', + value => throwIfNotValid(value, isUserNotificationSettingValid, 'myVideoStudioEditionFinished') + ) + @Column + myVideoStudioEditionFinished: UserNotificationSettingValue + @ForeignKey(() => UserModel) @Column userId: number @@ -215,6 +225,7 @@ export class UserNotificationSettingModel extends Model { abuseNewMessage: this.abuseNewMessage, abuseStateChange: this.abuseStateChange, newPeerTubeVersion: this.newPeerTubeVersion, + myVideoStudioEditionFinished: this.myVideoStudioEditionFinished, newPluginVersion: this.newPluginVersion } }