diff --git a/src/models/repositories/notification.ts b/src/models/repositories/notification.ts index b7f9e3643c..d1cf9b087e 100644 --- a/src/models/repositories/notification.ts +++ b/src/models/repositories/notification.ts @@ -2,15 +2,13 @@ import { EntityRepository, In, Repository } from 'typeorm'; import { Users, Notes, UserGroupInvitations, AccessTokens, NoteReactions } from '../index'; import { Notification } from '@/models/entities/notification'; import { awaitAll } from '@/prelude/await-all'; -import { SchemaType } from '@/misc/schema'; +import { Packed } from '@/misc/schema'; import { Note } from '@/models/entities/note'; import { NoteReaction } from '@/models/entities/note-reaction'; import { User } from '@/models/entities/user'; import { aggregateNoteEmojis, prefetchEmojis } from '@/misc/populate-emojis'; import { notificationTypes } from '@/types'; -export type PackedNotification = SchemaType; - @EntityRepository(Notification) export class NotificationRepository extends Repository { public async pack( @@ -20,7 +18,7 @@ export class NotificationRepository extends Repository { myReactions: Map; }; } - ): Promise { + ): Promise> { const notification = typeof src === 'object' ? src : await this.findOneOrFail(src); const token = notification.appAccessTokenId ? await AccessTokens.findOneOrFail(notification.appAccessTokenId) : null; diff --git a/src/services/push-notification.ts b/src/services/push-notification.ts index 23781acbe2..5949d11b3b 100644 --- a/src/services/push-notification.ts +++ b/src/services/push-notification.ts @@ -2,11 +2,10 @@ import * as push from 'web-push'; import config from '@/config/index'; import { SwSubscriptions } from '@/models/index'; import { fetchMeta } from '@/misc/fetch-meta'; -import { PackedNotification } from '../models/repositories/notification'; import { Packed } from '@/misc/schema'; type notificationType = 'notification' | 'unreadMessagingMessage'; -type notificationBody = PackedNotification | Packed<'MessagingMessage'>; +type notificationBody = Packed<'Notification'> | Packed<'MessagingMessage'>; export default async function(userId: string, type: notificationType, body: notificationBody) { const meta = await fetchMeta();