diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-01-20 18:10:47 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-20 18:10:47 +1100 |
commit | 084dc0be08555891cad4c2bb984822a62ec5ec9f (patch) | |
tree | ed2ca0fafefa2224ae32761f955f63935422a97d /src/api/routes/channels/#channel_id/purge.ts | |
parent | fix: route file regex (#956) (diff) | |
download | server-084dc0be08555891cad4c2bb984822a62ec5ec9f.tar.xz |
Add ESLint (#941)
* Add eslint, switch to lint-staged for precommit * Fix all ESLint errors * Update GH workflow to check prettier and eslint
Diffstat (limited to 'src/api/routes/channels/#channel_id/purge.ts')
-rw-r--r-- | src/api/routes/channels/#channel_id/purge.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/routes/channels/#channel_id/purge.ts b/src/api/routes/channels/#channel_id/purge.ts index 05660acf..04d8cfa2 100644 --- a/src/api/routes/channels/#channel_id/purge.ts +++ b/src/api/routes/channels/#channel_id/purge.ts @@ -19,10 +19,9 @@ import { HTTPError } from "lambert-server"; import { route } from "@fosscord/api"; import { isTextChannel } from "./messages"; -import { FindManyOptions, Between, Not } from "typeorm"; +import { FindManyOptions, Between, Not, FindOperator } from "typeorm"; import { Channel, - Config, emitEvent, getPermission, getRights, @@ -69,7 +68,9 @@ router.post( // TODO: send the deletion event bite-by-bite to prevent client stress - var query: FindManyOptions<Message> & { where: { id?: any } } = { + const query: FindManyOptions<Message> & { + where: { id?: FindOperator<string> }; + } = { order: { id: "ASC" }, // take: limit, where: { @@ -93,7 +94,6 @@ router.post( }; const messages = await Message.find(query); - const endpoint = Config.get().cdn.endpointPublic; if (messages.length == 0) { res.sendStatus(304); |