X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Fuser-notification-setting.ts;h=acc192d53f861df34f2d2e6dd17ec5e34ca559e7;hb=31c82cd914e13dbf53280d0aad0740d70c414441;hp=d8f3f13da1219116598d8bc1e67961fad026c814;hpb=4f32032fed8587ea97d45e235b167e8958efd81f;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/user-notification-setting.ts b/server/models/account/user-notification-setting.ts index d8f3f13da..acc192d53 100644 --- a/server/models/account/user-notification-setting.ts +++ b/server/models/account/user-notification-setting.ts @@ -12,12 +12,12 @@ import { Table, UpdatedAt } from 'sequelize-typescript' -import { throwIfNotValid } from '../utils' -import { UserModel } from './user' -import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' +import { MNotificationSettingFormattable } from '@server/types/models' import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model' +import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications' import { clearCacheByUserId } from '../../lib/oauth-model' -import { MNotificationSettingFormattable } from '@server/types/models' +import { throwIfNotValid } from '../utils' +import { UserModel } from './user' @Table({ tableName: 'userNotificationSetting', @@ -138,6 +138,24 @@ export class UserNotificationSettingModel extends Model throwIfNotValid(value, isUserNotificationSettingValid, 'abuseStateChange') + ) + @Column + abuseStateChange: UserNotificationSettingValue + + @AllowNull(false) + @Default(null) + @Is( + 'UserNotificationSettingAbuseNewMessage', + value => throwIfNotValid(value, isUserNotificationSettingValid, 'abuseNewMessage') + ) + @Column + abuseNewMessage: UserNotificationSettingValue + @ForeignKey(() => UserModel) @Column userId: number @@ -175,7 +193,9 @@ export class UserNotificationSettingModel extends Model