notification

This commit is contained in:
tamaina
2021-09-12 22:53:06 +09:00
parent 02f6142d01
commit 295ad35210
2 changed files with 3 additions and 6 deletions

View File

@@ -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<typeof packedNotificationSchema>;
@EntityRepository(Notification)
export class NotificationRepository extends Repository<Notification> {
public async pack(
@@ -20,7 +18,7 @@ export class NotificationRepository extends Repository<Notification> {
myReactions: Map<Note['id'], NoteReaction | null>;
};
}
): Promise<PackedNotification> {
): Promise<Packed<'Notification'>> {
const notification = typeof src === 'object' ? src : await this.findOneOrFail(src);
const token = notification.appAccessTokenId ? await AccessTokens.findOneOrFail(notification.appAccessTokenId) : null;