From 4ccae56210bfc5e0c0a0b863cac02596674ab5a0 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Mon, 18 Jul 2022 21:56:07 +0200 Subject: Update packages --- api/src/routes/channels/#channel_id/messages/#message_id/index.ts | 2 +- api/src/routes/channels/#channel_id/messages/index.ts | 2 +- api/src/routes/gifs/search.ts | 2 +- api/src/routes/gifs/trending-gifs.ts | 2 +- api/src/routes/gifs/trending.ts | 4 ++-- api/src/util/utility/ipAddress.ts | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'api/src') diff --git a/api/src/routes/channels/#channel_id/messages/#message_id/index.ts b/api/src/routes/channels/#channel_id/messages/#message_id/index.ts index 1f5b68c2..b7f1e130 100644 --- a/api/src/routes/channels/#channel_id/messages/#message_id/index.ts +++ b/api/src/routes/channels/#channel_id/messages/#message_id/index.ts @@ -116,7 +116,7 @@ router.put( if (req.file) { try { - const file = await uploadFile(`/attachments/${req.params.channel_id}`, req.file); + const file: any = await uploadFile(`/attachments/${req.params.channel_id}`, req.file); attachments.push({ ...file, proxy_url: file.url }); } catch (error) { return res.status(400).json(error); diff --git a/api/src/routes/channels/#channel_id/messages/index.ts b/api/src/routes/channels/#channel_id/messages/index.ts index 1ed6080e..6d4d5794 100644 --- a/api/src/routes/channels/#channel_id/messages/index.ts +++ b/api/src/routes/channels/#channel_id/messages/index.ts @@ -200,7 +200,7 @@ router.post( const files = req.files as Express.Multer.File[] ?? []; for (let currFile of files) { try { - const file = await uploadFile(`/attachments/${channel.id}`, currFile); + const file: any = await uploadFile(`/attachments/${channel.id}`, currFile); attachments.push({ ...file, proxy_url: file.url }); } catch (error) { diff --git a/api/src/routes/gifs/search.ts b/api/src/routes/gifs/search.ts index 9ad7a592..1099dc4a 100644 --- a/api/src/routes/gifs/search.ts +++ b/api/src/routes/gifs/search.ts @@ -20,7 +20,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { headers: { "Content-Type": "application/json" } }); - const { results } = await response.json(); + const { results } = await response.json() as any; res.json(results.map(parseGifResult)).status(200); }); diff --git a/api/src/routes/gifs/trending-gifs.ts b/api/src/routes/gifs/trending-gifs.ts index 6d97bf7c..2b28d9d2 100644 --- a/api/src/routes/gifs/trending-gifs.ts +++ b/api/src/routes/gifs/trending-gifs.ts @@ -20,7 +20,7 @@ router.get("/", route({}), async (req: Request, res: Response) => { headers: { "Content-Type": "application/json" } }); - const { results } = await response.json(); + const { results } = await response.json() as any; res.json(results.map(parseGifResult)).status(200); }); diff --git a/api/src/routes/gifs/trending.ts b/api/src/routes/gifs/trending.ts index c81b4c08..bc143f00 100644 --- a/api/src/routes/gifs/trending.ts +++ b/api/src/routes/gifs/trending.ts @@ -50,8 +50,8 @@ router.get("/", route({}), async (req: Request, res: Response) => { }) ]); - const { tags } = await responseSource.json(); - const { results } = await trendGifSource.json(); + const { tags } = await responseSource.json() as any; + const { results } = await trendGifSource.json() as any; res.json({ categories: tags.map((x: any) => ({ name: x.searchterm, src: x.image })), diff --git a/api/src/util/utility/ipAddress.ts b/api/src/util/utility/ipAddress.ts index 13cc9603..8d986b26 100644 --- a/api/src/util/utility/ipAddress.ts +++ b/api/src/util/utility/ipAddress.ts @@ -65,7 +65,7 @@ export async function IPAnalysis(ip: string): Promise { const { ipdataApiKey } = Config.get().security; if (!ipdataApiKey) return { ...exampleData, ip }; - return (await fetch(`https://api.ipdata.co/${ip}?api-key=${ipdataApiKey}`)).json(); + return (await fetch(`https://api.ipdata.co/${ip}?api-key=${ipdataApiKey}`)).json() as any; } export function isProxy(data: typeof exampleData) { -- cgit 1.5.1