Refactor
This commit is contained in:
@@ -5,13 +5,6 @@ import { ensure } from '../../prelude/ensure';
|
||||
|
||||
@EntityRepository(NoteFavorite)
|
||||
export class NoteFavoriteRepository extends Repository<NoteFavorite> {
|
||||
public packMany(
|
||||
favorites: any[],
|
||||
me: any
|
||||
) {
|
||||
return Promise.all(favorites.map(x => this.pack(x, me)));
|
||||
}
|
||||
|
||||
public async pack(
|
||||
src: NoteFavorite['id'] | NoteFavorite,
|
||||
me?: any
|
||||
@@ -23,4 +16,11 @@ export class NoteFavoriteRepository extends Repository<NoteFavorite> {
|
||||
note: await Notes.pack(favorite.note || favorite.noteId, me),
|
||||
};
|
||||
}
|
||||
|
||||
public packMany(
|
||||
favorites: any[],
|
||||
me: any
|
||||
) {
|
||||
return Promise.all(favorites.map(x => this.pack(x, me)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user