diff options
Diffstat (limited to 'server/models/user/user-notification.ts')
-rw-r--r-- | server/models/user/user-notification.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/models/user/user-notification.ts b/server/models/user/user-notification.ts index 6209cb4bf..d37fa5dc7 100644 --- a/server/models/user/user-notification.ts +++ b/server/models/user/user-notification.ts | |||
@@ -2,6 +2,7 @@ import { ModelIndexesOptions, Op, WhereOptions } from 'sequelize' | |||
2 | import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' | 2 | import { AllowNull, BelongsTo, Column, CreatedAt, Default, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' |
3 | import { getBiggestActorImage } from '@server/lib/actor-image' | 3 | import { getBiggestActorImage } from '@server/lib/actor-image' |
4 | import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user' | 4 | import { UserNotificationIncludes, UserNotificationModelForApi } from '@server/types/models/user' |
5 | import { forceNumber } from '@shared/core-utils' | ||
5 | import { uuidToShort } from '@shared/extra-utils' | 6 | import { uuidToShort } from '@shared/extra-utils' |
6 | import { UserNotification, UserNotificationType } from '@shared/models' | 7 | import { UserNotification, UserNotificationType } from '@shared/models' |
7 | import { AttributesOnly } from '@shared/typescript-utils' | 8 | import { AttributesOnly } from '@shared/typescript-utils' |
@@ -284,7 +285,7 @@ export class UserNotificationModel extends Model<Partial<AttributesOnly<UserNoti | |||
284 | } | 285 | } |
285 | 286 | ||
286 | static removeNotificationsOf (options: { id: number, type: 'account' | 'server', forUserId?: number }) { | 287 | static removeNotificationsOf (options: { id: number, type: 'account' | 'server', forUserId?: number }) { |
287 | const id = parseInt(options.id + '', 10) | 288 | const id = forceNumber(options.id) |
288 | 289 | ||
289 | function buildAccountWhereQuery (base: string) { | 290 | function buildAccountWhereQuery (base: string) { |
290 | const whereSuffix = options.forUserId | 291 | const whereSuffix = options.forUserId |