]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/account/user-notification-setting.ts
Merge branch 'release/3.1.0' into develop
[github/Chocobozzz/PeerTube.git] / server / models / account / user-notification-setting.ts
index de150129922ca57e0dced2524d2a9c222030d331..138051528d6f493da896a79773d37294f56c2093 100644 (file)
@@ -12,10 +12,10 @@ import {
   Table,
   UpdatedAt
 } from 'sequelize-typescript'
+import { TokensCache } from '@server/lib/auth/tokens-cache'
 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 { throwIfNotValid } from '../utils'
 import { UserModel } from './user'
 
@@ -195,7 +195,7 @@ export class UserNotificationSettingModel extends Model {
   @AfterUpdate
   @AfterDestroy
   static removeTokenCache (instance: UserNotificationSettingModel) {
-    return clearCacheByUserId(instance.userId)
+    return TokensCache.Instance.clearCacheByUserId(instance.userId)
   }
 
   toFormattedJSON (this: MNotificationSettingFormattable): UserNotificationSetting {