]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/user-notification-setting.ts
Fix lint
[github/Chocobozzz/PeerTube.git] / server / models / account / user-notification-setting.ts
index 1506295cf7f7183ad9e6b2c29fac9bb32e86fd9d..b69b4726575ebf9447e43468e3531653a328551c 100644 (file)
@@ -17,7 +17,7 @@ import { UserModel } from './user'
 import { isUserNotificationSettingValid } from '../../helpers/custom-validators/user-notifications'
 import { UserNotificationSetting, UserNotificationSettingValue } from '../../../shared/models/users/user-notification-setting.model'
 import { clearCacheByUserId } from '../../lib/oauth-model'
-import { MNotificationSettingFormattable } from '@server/typings/models'
+import { MNotificationSettingFormattable } from '@server/types/models'
 
 @Table({
   tableName: 'userNotificationSetting',
@@ -111,6 +111,15 @@ export class UserNotificationSettingModel extends Model<UserNotificationSettingM
   @Column
   newInstanceFollower: UserNotificationSettingValue
 
+  @AllowNull(false)
+  @Default(null)
+  @Is(
+    'UserNotificationSettingNewInstanceFollower',
+    value => throwIfNotValid(value, isUserNotificationSettingValid, 'autoInstanceFollowing')
+  )
+  @Column
+  autoInstanceFollowing: UserNotificationSettingValue
+
   @AllowNull(false)
   @Default(null)
   @Is(
@@ -165,7 +174,8 @@ export class UserNotificationSettingModel extends Model<UserNotificationSettingM
       newUserRegistration: this.newUserRegistration,
       commentMention: this.commentMention,
       newFollow: this.newFollow,
-      newInstanceFollower: this.newInstanceFollower
+      newInstanceFollower: this.newInstanceFollower,
+      autoInstanceFollowing: this.autoInstanceFollowing
     }
   }
 }