diff options
Diffstat (limited to 'api/src/util/handlers')
-rw-r--r-- | api/src/util/handlers/Message.ts | 12 | ||||
-rw-r--r-- | api/src/util/handlers/route.ts | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/api/src/util/handlers/Message.ts b/api/src/util/handlers/Message.ts index 48f87dfe..31ac9108 100644 --- a/api/src/util/handlers/Message.ts +++ b/api/src/util/handlers/Message.ts @@ -102,11 +102,11 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { throw new HTTPError("Empty messages are not allowed", 50006); } - var content = opts.content; - var mention_channel_ids = [] as string[]; - var mention_role_ids = [] as string[]; - var mention_user_ids = [] as string[]; - var mention_everyone = false; + let content = opts.content; + let mention_channel_ids = [] as string[]; + let mention_role_ids = [] as string[]; + let mention_user_ids = [] as string[]; + let mention_everyone = false; if (content) { // TODO: explicit-only mentions message.content = content.trim(); @@ -144,7 +144,7 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> { // TODO: cache link result in db export async function postHandleMessage(message: Message) { - var links = message.content?.match(LINK_REGEX); + let links = message.content?.match(LINK_REGEX); if (!links) return; const data = { ...message }; diff --git a/api/src/util/handlers/route.ts b/api/src/util/handlers/route.ts index 3d3bbc37..eaf7dc91 100644 --- a/api/src/util/handlers/route.ts +++ b/api/src/util/handlers/route.ts @@ -87,7 +87,7 @@ const normalizeBody = (body: any = {}) => { }; export function route(opts: RouteOptions) { - var validate: AnyValidateFunction<any> | undefined; + let validate: AnyValidateFunction<any> | undefined; if (opts.body) { validate = ajv.getSchema(opts.body); if (!validate) throw new Error(`Body schema ${opts.body} not found`); |