Refactor
This commit is contained in:
parent
6721d27e3f
commit
4cb58c0892
10 changed files with 84 additions and 84 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue