diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-18 22:55:36 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-18 22:55:36 +0200 |
commit | 0def560d113f6d2356360041e92346dc4faa17b0 (patch) | |
tree | c672cb853e3a6001c50a7b50a94d0d75ff11c5f4 /api | |
parent | Merge branch 'master' of http://github.com/fosscord/fosscord-server (diff) | |
download | server-0def560d113f6d2356360041e92346dc4faa17b0.tar.xz |
:bug: fix bulk delete
Diffstat (limited to 'api')
-rw-r--r-- | api/src/routes/channels/#channel_id/messages/bulk-delete.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/api/src/routes/channels/#channel_id/messages/bulk-delete.ts b/api/src/routes/channels/#channel_id/messages/bulk-delete.ts index a0fe7cc0..7a711cb0 100644 --- a/api/src/routes/channels/#channel_id/messages/bulk-delete.ts +++ b/api/src/routes/channels/#channel_id/messages/bulk-delete.ts @@ -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", |