1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +01:00

Update index.ts

This commit is contained in:
Flam3rboy 2021-09-20 18:33:33 +02:00 committed by GitHub
parent a4811d86ce
commit 2d183f4c45

View File

@ -1,4 +1,4 @@
import { Channel, Message, Invite, ReadState, ChannelDeleteEvent, ChannelPermissionOverwriteType, ChannelType, ChannelUpdateEvent, emitEvent, Recipient } from "@fosscord/util";
import { Channel, ChannelDeleteEvent, ChannelPermissionOverwriteType, ChannelType, ChannelUpdateEvent, emitEvent, Recipient } from "@fosscord/util";
import { Request, Response, Router } from "express";
import { handleFile, route } from "@fosscord/api";
@ -31,10 +31,6 @@ router.delete("/", route({ permission: "MANAGE_CHANNELS" }), async (req: Request
await Channel.removeRecipientFromChannel(channel, req.user_id)
} else {
await Promise.all([
Invite.delete({ channel_id: channel_id }),
ReadState.delete({ channel_id: channel_id }),
Message.delete({ channel_id: channel_id }),
Recipient.delete({ channel_id: channel_id }),
Channel.delete({ id: channel_id }),
emitEvent({ event: "CHANNEL_DELETE", data: channel, channel_id } as ChannelDeleteEvent)
]);