diff --git a/src/app/models/index.ts b/src/app/models/index.ts index 5226bcb3..fe3b69b7 100644 --- a/src/app/models/index.ts +++ b/src/app/models/index.ts @@ -203,6 +203,6 @@ export default (database: Sequelize) => { [Limit.name]: Limit, [PaidPlans.name]: PaidPlans, [TierLimit.name]: TierLimit, - [UserNotificationToken.name]: UserNotificationToken, + ['userNotificationToken']: UserNotificationToken, }; }; diff --git a/src/app/routes/storage.ts b/src/app/routes/storage.ts index 5ebe705e..634b3720 100644 --- a/src/app/routes/storage.ts +++ b/src/app/routes/storage.ts @@ -811,7 +811,7 @@ export class StorageController { private async getTokensAndSendNotification(userUuid: string) { const tokens = await this.services.User.getUserNotificationTokens(userUuid, 'macos'); - tokens.forEach((token: string) => { + tokens.forEach(({ token }: { token: string }) => { this.services.Apn.sendStorageNotification(token, userUuid); }); } diff --git a/src/app/services/user.js b/src/app/services/user.js index 246feb9c..4ebbb561 100644 --- a/src/app/services/user.js +++ b/src/app/services/user.js @@ -806,7 +806,7 @@ module.exports = (Model, App) => { if (type !== null) { whereClause.type = type; } - return Model.UserNotificationToken.findAll({ where: whereClause }); + return Model.userNotificationToken.findAll({ where: whereClause }); }; return {