summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorCyberL1 <cyber.hf18@gmail.com>2025-10-02 15:39:18 +0200
committerRory& <root@rory.gay>2025-10-02 18:55:47 +0200
commit9ef9744332ccc4de597ec98e75f0109ab4cc893c (patch)
treec4a12639f2a038407c6503de20961907a9b38ad2 /src
parentLog schema in validator? (diff)
downloadserver-ts-9ef9744332ccc4de597ec98e75f0109ab4cc893c.tar.xz
fix: getting invites for a channel
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/channels/#channel_id/invites.ts19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/api/routes/channels/#channel_id/invites.ts b/src/api/routes/channels/#channel_id/invites.ts

index b283558b4..086c1eb36 100644 --- a/src/api/routes/channels/#channel_id/invites.ts +++ b/src/api/routes/channels/#channel_id/invites.ts
@@ -17,17 +17,7 @@ */ import { randomString, route } from "@spacebar/api"; -import { - Channel, - Guild, - Invite, - InviteCreateEvent, - InviteCreateSchema, - PublicInviteRelation, - User, - emitEvent, - isTextChannel, -} from "@spacebar/util"; +import { Channel, Guild, Invite, InviteCreateEvent, InviteCreateSchema, PublicInviteRelation, User, emitEvent, isTextChannel } from "@spacebar/util"; import { Request, Response, Router } from "express"; import { HTTPError } from "lambert-server"; @@ -64,10 +54,7 @@ router.post( } const { guild_id } = channel; - const expires_at = - body.max_age == 0 || body.max_age == undefined - ? undefined - : new Date(body.max_age * 1000 + Date.now()); + const expires_at = body.max_age == 0 || body.max_age == undefined ? undefined : new Date(body.max_age * 1000 + Date.now()); const invite = await Invite.create({ code: randomString(), @@ -121,7 +108,7 @@ router.get( const { guild_id } = channel; const invites = await Invite.find({ - where: { guild_id }, + where: { guild_id, channel_id }, relations: PublicInviteRelation, });