summary refs log tree commit diff
path: root/api/src/routes/guilds/templates
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-06 18:25:30 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-09 23:28:27 +0200
commitcba3844c6f7a6b26c93d8061da0ca7fe6b291e92 (patch)
tree515a4000f4d26ab1999644b9dd6a057e03041bcf /api/src/routes/guilds/templates
parentmigrate to DataSource (diff)
downloadserver-ts-cba3844c6f7a6b26c93d8061da0ca7fe6b291e92.tar.xz
Resolve changes undone by rebasing from master
Diffstat (limited to 'api/src/routes/guilds/templates')
-rw-r--r--api/src/routes/guilds/templates/index.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/api/src/routes/guilds/templates/index.ts b/api/src/routes/guilds/templates/index.ts

index 3d922e85..e2242ebf 100644 --- a/api/src/routes/guilds/templates/index.ts +++ b/api/src/routes/guilds/templates/index.ts
@@ -33,7 +33,7 @@ router.get("/:code", route({}), async (req: Request, res: Response) => { return res.json(code.split("external:", 2)[1]); } - const template = await Template.findOneOrFail({ code: code }); + const template = await Template.findOneOrFail({ where: { code } }); res.json(template); }); @@ -47,12 +47,12 @@ router.post("/:code", route({ body: "GuildTemplateCreateSchema" }), async (req: const { maxGuilds } = Config.get().limits.user; - const guild_count = await Member.count({ id: req.user_id }); + const guild_count = await Member.count({ where: { id: req.user_id } }); if (guild_count >= maxGuilds) { throw DiscordApiErrors.MAXIMUM_GUILDS.withParams(maxGuilds); } - const template = await Template.findOneOrFail({ code: code }); + const template = await Template.findOneOrFail({ where: { code } }); const guild_id = Snowflake.generate();