import { db } from "../../db/postgre.js";
import { FollowRequest } from "../entities/follow-request.js";
import { Users } from "../index.js";
export const FollowRequestRepository = db.getRepository(FollowRequest).extend({
    async pack (src, me) {
        const request = typeof src === "object" ? src : await this.findOneByOrFail({
            id: src
        });
        return {
            id: request.id,
            follower: await Users.pack(request.followerId, me),
            followee: await Users.pack(request.followeeId, me)
        };
    }
});
