summary refs log tree commit diff
path: root/api/src/routes/channels/#channel_id/pins.ts
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-31 17:58:47 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-08-31 17:58:47 +0200
commit3f66c101789f9a6d065490d3e3265c764698113f (patch)
tree97b1ef821e2dd8124e5d38a822c08efe21e7eaa2 /api/src/routes/channels/#channel_id/pins.ts
parent:sparkles: channel recipients (diff)
downloadserver-3f66c101789f9a6d065490d3e3265c764698113f.tar.xz
:bug: db query fixes
Diffstat (limited to 'api/src/routes/channels/#channel_id/pins.ts')
-rw-r--r--api/src/routes/channels/#channel_id/pins.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/routes/channels/#channel_id/pins.ts b/api/src/routes/channels/#channel_id/pins.ts
index d83e36ed..96a3fdbf 100644
--- a/api/src/routes/channels/#channel_id/pins.ts
+++ b/api/src/routes/channels/#channel_id/pins.ts
@@ -14,7 +14,7 @@ router.put("/:message_id", async (req: Request, res: Response) => {
 	// * in dm channels anyone can pin messages -> only check for guilds
 	if (message.guild_id) permission.hasThrow("MANAGE_MESSAGES");
 
-	const pinned_count = await Message.count({ channel_id, pinned: true });
+	const pinned_count = await Message.count({ channel: { id: channel_id }, pinned: true });
 	const { maxPins } = Config.get().limits.channel;
 	if (pinned_count >= maxPins) throw new HTTPError("Max pin count reached: " + maxPins);