mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-15 00:55:25 +00:00
🐛 fix bulk delete
This commit is contained in:
@@ -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