summary refs log tree commit diff
path: root/api/src/routes/guilds/#guild_id/widget.png.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-24 16:35:04 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-24 16:35:04 +0200
commitef4d4a318176c3e572adc17427a8b8c728a618ab (patch)
treed95fedbf18b7b7438613b08b72eb30fa5fca8921 /api/src/routes/guilds/#guild_id/widget.png.ts
parent:sparkles: typeorm entities (diff)
downloadserver-ef4d4a318176c3e572adc17427a8b8c728a618ab.tar.xz
:construction: api
Diffstat (limited to 'api/src/routes/guilds/#guild_id/widget.png.ts')
-rw-r--r--api/src/routes/guilds/#guild_id/widget.png.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/routes/guilds/#guild_id/widget.png.ts b/api/src/routes/guilds/#guild_id/widget.png.ts
index 80dc9f2b..89b31153 100644
--- a/api/src/routes/guilds/#guild_id/widget.png.ts
+++ b/api/src/routes/guilds/#guild_id/widget.png.ts
@@ -1,5 +1,5 @@
 import { Request, Response, Router } from "express";
-import { GuildModel } from "@fosscord/util";
+import { Guild } from "@fosscord/util";
 import { HTTPError } from "lambert-server";
 import fs from "fs";
 import path from "path";
@@ -13,7 +13,7 @@ const router: Router = Router();
 router.get("/", async (req: Request, res: Response) => {
 	const { guild_id } = req.params;
 
-	const guild = await GuildModel.findOne({ id: guild_id }).exec();
+	const guild = await Guild.findOneOrFail({ id: guild_id });
 	if (!guild.widget_enabled) throw new HTTPError("Unknown Guild", 404);
 
 	// Fetch guild information