This commit is contained in:
syuilo
2019-04-25 13:27:07 +09:00
parent 6721d27e3f
commit 4cb58c0892
10 changed files with 84 additions and 84 deletions

View File

@@ -9,12 +9,6 @@ export type PackedNotification = SchemaType<typeof packedNotificationSchema>;
@EntityRepository(Notification)
export class NotificationRepository extends Repository<Notification> {
public packMany(
notifications: any[],
) {
return Promise.all(notifications.map(x => this.pack(x)));
}
public async pack(
src: Notification['id'] | Notification,
): Promise<PackedNotification> {
@@ -48,6 +42,12 @@ export class NotificationRepository extends Repository<Notification> {
} : {})
});
}
public packMany(
notifications: any[],
) {
return Promise.all(notifications.map(x => this.pack(x)));
}
}
export const packedNotificationSchema = {