Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { db } from "../../db/postgre.js";
|
||||
import { UserList } from "../entities/user-list.js";
|
||||
import { UserListJoinings } from "../index.js";
|
||||
export const UserListRepository = db.getRepository(UserList).extend({
|
||||
async pack (src) {
|
||||
const userList = typeof src === "object" ? src : await this.findOneByOrFail({
|
||||
id: src
|
||||
});
|
||||
const users = await UserListJoinings.findBy({
|
||||
userListId: userList.id
|
||||
});
|
||||
return {
|
||||
id: userList.id,
|
||||
createdAt: userList.createdAt.toISOString(),
|
||||
name: userList.name,
|
||||
hideFromHomeTl: userList.hideFromHomeTl,
|
||||
userIds: users.map((x)=>x.userId)
|
||||
};
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user