mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 15:22:43 +00:00
🐛 fix bulk delete
This commit is contained in:
1 parent
208d99de3a
commit
2a85285e63
1 file changed
+1
-1
@@ -29,7 +29,7 @@ router.post("/", route({ body: "BulkDeleteSchema" }), async (req: Request, res:
|
||||
if (messages.length < 2) throw new HTTPError("You must at least specify 2 messages to bulk delete");
|
||||
if (messages.length > maxBulkDelete) throw new HTTPError(`You cannot delete more than ${maxBulkDelete} messages`);
|
||||
|
||||
await Message.delete({ id: In(messages) });
|
||||
await Message.delete(messages.map((x) => ({ id: x })));
|
||||
|
||||
await emitEvent({
|
||||
event: "MESSAGE_DELETE_BULK",
|
||||
|
||||
Reference in new issue
Block a user