From e7e3f6ef080e5b14e44a7ed8379e7bcda6ad2272 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 4 Sep 2021 11:25:10 +0200 Subject: :bug: fix invites --- api/src/routes/channels/#channel_id/invites.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'api/src/routes/channels') diff --git a/api/src/routes/channels/#channel_id/invites.ts b/api/src/routes/channels/#channel_id/invites.ts index fcc8a1ad..fe22d3bc 100644 --- a/api/src/routes/channels/#channel_id/invites.ts +++ b/api/src/routes/channels/#channel_id/invites.ts @@ -1,12 +1,9 @@ import { Router, Request, Response } from "express"; import { HTTPError } from "lambert-server"; - import { check } from "../../../util/instanceOf"; import { random } from "../../../util/RandomInviteID"; - import { InviteCreateSchema } from "../../../schema/Invite"; - -import { getPermission, Channel, Invite, InviteCreateEvent, emitEvent, User, Guild } from "@fosscord/util"; +import { getPermission, Channel, Invite, InviteCreateEvent, emitEvent, User, Guild, PublicInviteRelation } from "@fosscord/util"; import { isTextChannel } from "./messages"; const router: Router = Router(); @@ -74,7 +71,7 @@ router.get("/", async (req: Request, res: Response) => { const permission = await getPermission(user_id, guild_id); permission.hasThrow("MANAGE_CHANNELS"); - const invites = await Invite.find({ guild_id }); + const invites = await Invite.find({ where: { guild_id }, relations: PublicInviteRelation }); res.status(200).send(invites); }); -- cgit 1.5.1