Refactor
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user