mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-28 19:58:16 +00:00
HACKHACK: Migrate to typeorm v1.0.0, still work to do in actually updating all the queries properly
This commit is contained in:
@@ -546,7 +546,7 @@ export class Channel extends BaseClass {
|
||||
channel_id: channel.id,
|
||||
user: await User.findOneOrFail({
|
||||
where: { id: user_id },
|
||||
select: PublicUserProjection,
|
||||
select: Object.fromEntries(PublicUserProjection.map((i) => [i, true])), //TODO: cleanup
|
||||
}),
|
||||
},
|
||||
channel_id: channel.id,
|
||||
|
||||
@@ -335,7 +335,7 @@ export class Member extends BaseClassWithoutId {
|
||||
where: {
|
||||
id: guild_id,
|
||||
},
|
||||
relations: PublicGuildRelations,
|
||||
relations: Object.fromEntries(PublicGuildRelations.map((i) => [i, true])), //TODO: clean up
|
||||
relationLoadStrategy: "query",
|
||||
});
|
||||
const channelPositionsGuild = await Guild.findOneOrFail({
|
||||
|
||||
@@ -235,7 +235,7 @@ export class User extends BaseClass {
|
||||
static async getPublicUser(user_id: string): Promise<PublicUser> {
|
||||
const user = await User.findOneOrFail({
|
||||
where: { id: user_id },
|
||||
select: PublicUserProjection,
|
||||
select: Object.fromEntries(PublicUserProjection.map((i) => [i, true])), // TODO: clean up
|
||||
});
|
||||
return user.toPublicUser();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user