Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { db } from "../../db/postgre.js";
|
||||
import { Users } from "../index.js";
|
||||
import { CallBlocking } from "../entities/call-blocking.js";
|
||||
import { awaitAll } from "../../prelude/await-all.js";
|
||||
export const CallBlockingRepository = db.getRepository(CallBlocking).extend({
|
||||
async pack (src, me) {
|
||||
const blocking = typeof src === "object" ? src : await this.findOneByOrFail({
|
||||
id: src
|
||||
});
|
||||
return await awaitAll({
|
||||
id: blocking.id,
|
||||
createdAt: blocking.createdAt.toISOString(),
|
||||
blockeeId: blocking.blockeeId,
|
||||
blockee: Users.pack(blocking.blockeeId, me, {
|
||||
detail: true
|
||||
})
|
||||
});
|
||||
},
|
||||
packMany (blockings, me) {
|
||||
return Promise.all(blockings.map((x)=>this.pack(x, me)));
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user