diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-20 18:10:47 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-20 18:10:47 +1100 |
commit | 084dc0be08555891cad4c2bb984822a62ec5ec9f (patch) | |
tree | ed2ca0fafefa2224ae32761f955f63935422a97d /src/api/routes/guilds/#guild_id/templates.ts | |
parent | fix: route file regex (#956) (diff) | |
download | server-084dc0be08555891cad4c2bb984822a62ec5ec9f.tar.xz |
Add ESLint (#941)
* Add eslint, switch to lint-staged for precommit * Fix all ESLint errors * Update GH workflow to check prettier and eslint
Diffstat (limited to 'src/api/routes/guilds/#guild_id/templates.ts')
-rw-r--r-- | src/api/routes/guilds/#guild_id/templates.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/routes/guilds/#guild_id/templates.ts b/src/api/routes/guilds/#guild_id/templates.ts index f5244313..284bbccf 100644 --- a/src/api/routes/guilds/#guild_id/templates.ts +++ b/src/api/routes/guilds/#guild_id/templates.ts @@ -44,7 +44,7 @@ const TemplateGuildProjection: (keyof Guild)[] = [ router.get("/", route({}), async (req: Request, res: Response) => { const { guild_id } = req.params; - var templates = await Template.find({ + const templates = await Template.find({ where: { source_guild_id: guild_id }, }); @@ -60,9 +60,9 @@ router.post( where: { id: guild_id }, select: TemplateGuildProjection, }); - const exists = await Template.findOneOrFail({ + const exists = await Template.findOne({ where: { id: guild_id }, - }).catch((e) => {}); + }); if (exists) throw new HTTPError("Template already exists", 400); const template = await Template.create({ |