diff --git a/src/api/middlewares/Authentication.ts b/src/api/middlewares/Authentication.ts
index ad949b25a..a35c5fbca 100644
--- a/src/api/middlewares/Authentication.ts
+++ b/src/api/middlewares/Authentication.ts
@@ -120,7 +120,7 @@ export async function Authentication(req: Request, res: Response, next: NextFunc
if (!req.headers.authorization) return next(new HTTPError("Missing Authorization Header", 401));
try {
- const { decoded, user, session, tokenVersion } = (req.tokenData = await checkToken(req.headers.authorization, {
+ const { decoded, user, session } = (req.tokenData = await checkToken(req.headers.authorization, {
ipAddress: req.ip,
fingerprint: req.fingerprint,
}));
diff --git a/src/api/routes/channels/#channel_id/thread-members.ts b/src/api/routes/channels/#channel_id/thread-members.ts
index 281ed2f90..83b1b2930 100644
--- a/src/api/routes/channels/#channel_id/thread-members.ts
+++ b/src/api/routes/channels/#channel_id/thread-members.ts
@@ -50,12 +50,14 @@ router.get(
limit = undefined;
}
- return await ThreadMember.find({
- where: { channel: { id: channel_id }, ...(after ? { user_id: MoreThan(after) } : {}) },
- take: limit ? parseInt(limit) : 50,
- order: { member_idx: "ASC" },
- relations: { ...(with_member ? { member: true } : {}) },
- });
+ return res.send(
+ await ThreadMember.find({
+ where: { channel: { id: channel_id }, ...(after ? { user_id: MoreThan(after) } : {}) },
+ take: limit ? parseInt(limit) : 50,
+ order: { member_idx: "ASC" },
+ relations: { ...(with_member ? { member: true } : {}) },
+ }),
+ );
},
);
router.post(
diff --git a/src/api/routes/channels/#channel_id/threads.ts b/src/api/routes/channels/#channel_id/threads.ts
index 22b29e527..e81c8d791 100644
--- a/src/api/routes/channels/#channel_id/threads.ts
+++ b/src/api/routes/channels/#channel_id/threads.ts
@@ -217,6 +217,7 @@ router.get(
},
}),
async (req: Request, res: Response) => {
+ // noinspection JSUnusedLocalSymbols - ???
const { name, slop, tag, tag_setting, archived, sort_by, sort_order, limit, offset, max_id, min_id } = req.query as Record<string, string | undefined>;
const tags = tag ? tag.split(",") : [];
const { channel_id } = req.params as Record<string, string>;
diff --git a/src/api/routes/guilds/automations/email-domain-lookup.ts b/src/api/routes/guilds/automations/email-domain-lookup.ts
index 943097f8f..63ec39d43 100644
--- a/src/api/routes/guilds/automations/email-domain-lookup.ts
+++ b/src/api/routes/guilds/automations/email-domain-lookup.ts
@@ -59,6 +59,7 @@ router.post(
},
);
+// noinspection JSUnusedLocalSymbols - TODO: implement
router.post(
"/verify-code",
route({
diff --git a/src/api/routes/reporting/index.ts b/src/api/routes/reporting/index.ts
index a04f76de2..7f8e539e9 100644
--- a/src/api/routes/reporting/index.ts
+++ b/src/api/routes/reporting/index.ts
@@ -66,6 +66,7 @@ for (const type of Object.values(ReportMenuTypeNames)) {
},
);
if (process.env.LOG_ROUTES !== "false") console.log(`[Server] Route /reporting/menu/${type} registered (reports).`);
+ // noinspection JSUnusedLocalSymbols - TODO: implement
router.post(
`/${type}`,
route({
diff --git a/src/api/routes/webhooks/#webhook_id/#token/index.ts b/src/api/routes/webhooks/#webhook_id/#token/index.ts
index 556ee489f..1dd2dac43 100644
--- a/src/api/routes/webhooks/#webhook_id/#token/index.ts
+++ b/src/api/routes/webhooks/#webhook_id/#token/index.ts
@@ -149,6 +149,7 @@ router.patch(
},
}),
async (req: Request, res: Response) => {
+ // noinspection JSUnusedLocalSymbols - TODO: shouldnt token be checked?
const { webhook_id, token } = req.params as { [key: string]: string };
const body = req.body as WebhookUpdateSchema;
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts
index 5ec13dd6b..c21a47b43 100644
--- a/src/api/util/handlers/Message.ts
+++ b/src/api/util/handlers/Message.ts
@@ -228,6 +228,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
}
} else {
permission ||= await getPermission(opts.author_id, channel.guild_id, channel);
+ if (permission === null) throw new HTTPError("permission was null after getPermission", 500);
permission.hasThrow("SEND_MESSAGES");
if (permission.cache.member) {
message.member = permission.cache.member;
@@ -238,7 +239,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
permission.hasThrow("READ_MESSAGE_HISTORY");
// code below has to be redone when we add custom message routing
if (message.guild_id !== null) {
- const guild = await Guild.findOneOrFail({
+ await Guild.findOneOrFail({
where: { id: channel.guild_id },
});
if (!opts.message_reference.guild_id) opts.message_reference.guild_id = channel.guild_id;
|