mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-18 21:45:41 +00:00
properly mark unused params
This commit is contained in:
@@ -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,
|
||||
}));
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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>;
|
||||
|
||||
@@ -59,6 +59,7 @@ router.post(
|
||||
},
|
||||
);
|
||||
|
||||
// noinspection JSUnusedLocalSymbols - TODO: implement
|
||||
router.post(
|
||||
"/verify-code",
|
||||
route({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user