summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-21 15:16:57 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-21 15:16:57 +1000
commit97a92c7187fd9ab12bebd63d77ac5c91b8bdd91e (patch)
tree73d1d34c87e08947e93d4d2cdaf4fe0e5f5e8a79
parentMore sentry shit (diff)
downloadserver-97a92c7187fd9ab12bebd63d77ac5c91b8bdd91e.tar.xz
fix my shit
-rw-r--r--api/src/routes/users/@me/guilds/#guild_id/settings.ts (renamed from api/src/routes/users/@me/guilds/settings.ts)4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/routes/users/@me/guilds/settings.ts b/api/src/routes/users/@me/guilds/#guild_id/settings.ts
index 03029fcc..1c14bc36 100644
--- a/api/src/routes/users/@me/guilds/settings.ts
+++ b/api/src/routes/users/@me/guilds/#guild_id/settings.ts
@@ -9,7 +9,7 @@ export interface UserGuildSettingsSchema extends Partial<UserGuildSettings> { }
 // GET doesn't exist on discord.com
 router.get("/", route({}), async (req: Request, res: Response) => {
 	const user = await Member.findOneOrFail({
-		where: { id: req.user_id },
+		where: { id: req.user_id, guild_id: req.params.guild_id },
 		select: ["settings"]
 	});
 	return res.json(user.settings);
@@ -18,7 +18,7 @@ router.get("/", route({}), async (req: Request, res: Response) => {
 router.patch("/", route({ body: "UserSettingsSchema" }), async (req: Request, res: Response) => {
 	const body = req.body as UserGuildSettings;
 
-	const user = await Member.findOneOrFail({ where: { id: req.user_id } });
+	const user = await Member.findOneOrFail({ where: { id: req.user_id, guild_id: req.params.guild_id } });
 	user.settings = { ...user.settings, ...body };
 	await user.save();