X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Fuser-notification-setting.ts;h=138051528d6f493da896a79773d37294f56c2093;hb=dc48fdbe68e9dd3a3a6028181e61d8595d98e654;hp=de150129922ca57e0dced2524d2a9c222030d331;hpb=32a18cbf33a7cdbbe3d4885d32e4b67e19cdc1cf;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/user-notification-setting.ts b/server/models/account/user-notification-setting.ts index de1501299..138051528 100644 --- a/server/models/account/user-notification-setting.ts +++ b/server/models/account/user-notification-setting.ts @@ -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 {