Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { db } from "../../db/postgre.js";
|
||||
import { GalleryLike } from "../entities/gallery-like.js";
|
||||
import { GalleryPosts } from "../index.js";
|
||||
export const GalleryLikeRepository = db.getRepository(GalleryLike).extend({
|
||||
async pack (src, me) {
|
||||
const like = typeof src === "object" ? src : await this.findOneByOrFail({
|
||||
id: src
|
||||
});
|
||||
return {
|
||||
id: like.id,
|
||||
post: await GalleryPosts.pack(like.post || like.postId, me)
|
||||
};
|
||||
},
|
||||
packMany (likes, me) {
|
||||
return Promise.all(likes.map((x)=>this.pack(x, me)));
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user