diff --git a/src/api/routes/download.ts b/src/api/routes/download.ts index 85fb41b..58a4ce7 100644 --- a/src/api/routes/download.ts +++ b/src/api/routes/download.ts @@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { FieldErrors, Release } from "@spacebar/util"; +import { FieldErrors, ClientRelease } from "@spacebar/util"; import { Request, Response, Router } from "express"; const router = Router(); @@ -43,7 +43,7 @@ }, }); - const release = await Release.findOneOrFail({ + const release = await ClientRelease.findOneOrFail({ where: { enabled: true, platform: platform as string, diff --git "a/src/api/routes/guilds/\043guild_id/index.ts" "b/src/api/routes/guilds/\043guild_id/index.ts" index 75d05c9..d2310f6 100644 --- "a/src/api/routes/guilds/\043guild_id/index.ts" +++ "b/src/api/routes/guilds/\043guild_id/index.ts" @@ -108,6 +108,14 @@ relations: ["emojis", "roles", "stickers"], }); + // trying to `select` this fails + guild.channel_ordering = ( + await Guild.findOneOrFail({ + where: { id: guild_id }, + select: { channel_ordering: true }, + }) + ).channel_ordering; + // TODO: guild update check image if (body.icon && body.icon != guild.icon) diff --git a/src/api/routes/updates.ts b/src/api/routes/updates.ts index 101bd3b..04a455b 100644 --- a/src/api/routes/updates.ts +++ b/src/api/routes/updates.ts @@ -17,7 +17,7 @@ */ import { route } from "@spacebar/api"; -import { FieldErrors, Release } from "@spacebar/util"; +import { FieldErrors, ClientRelease } from "@spacebar/util"; import { Request, Response, Router } from "express"; const router = Router(); @@ -48,7 +48,7 @@ }, }); - const release = await Release.findOneOrFail({ + const release = await ClientRelease.findOneOrFail({ where: { enabled: true, platform: platform as string, diff --git a/src/util/entities/ClientRelease.ts b/src/util/entities/ClientRelease.ts index aa69793..9eb6750 100644 --- a/src/util/entities/ClientRelease.ts +++ b/src/util/entities/ClientRelease.ts @@ -24,7 +24,7 @@ name: "client_release", engine: dbEngine, }) -export class Release extends BaseClass { +export class ClientRelease extends BaseClass { @Column() name: string;