1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-11 05:02:37 +01:00

oRdEr Of OpErAtIoNs

This commit is contained in:
Chris Chrome 2021-09-20 12:16:17 -04:00
parent fe49c419f5
commit 2102db2e7c
No known key found for this signature in database
GPG Key ID: A023A26E42C33A42

View File

@ -31,10 +31,10 @@ router.delete("/", route({ permission: "MANAGE_CHANNELS" }), async (req: Request
await Channel.removeRecipientFromChannel(channel, req.user_id)
} else {
await Promise.all([
Message.delete({ channel_id: channel_id }),
Invite.delete({ channel_id: channel_id }),
Recipient.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)
]);