summary refs log tree commit diff
path: root/src/api/routes/gifs/trending.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 12:55:42 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 13:00:31 +1000
commitd946547a9233d866e793e1c68f11d98cb2f7d390 (patch)
tree2ff2677432e2e874f0784b115202f3846e68deb0 /src/api/routes/gifs/trending.ts
parentMerge remote-tracking branch 'upstream/staging' into fix/categoryNames (diff)
parentMerge pull request #799 from MaddyUnderStars/feat/captchaVerify (diff)
downloadserver-d946547a9233d866e793e1c68f11d98cb2f7d390.tar.xz
Merge remote-tracking branch 'upstream/staging' into fix/categoryNames
Also allow voice to skip checks
Diffstat (limited to 'src/api/routes/gifs/trending.ts')
-rw-r--r--src/api/routes/gifs/trending.ts15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/api/routes/gifs/trending.ts b/src/api/routes/gifs/trending.ts
index 61eb76c4..45396ff0 100644
--- a/src/api/routes/gifs/trending.ts
+++ b/src/api/routes/gifs/trending.ts
@@ -1,9 +1,8 @@
-import { Router, Response, Request } from "express";
-import fetch from "node-fetch";
-import ProxyAgent from 'proxy-agent';
 import { route } from "@fosscord/api";
-import { Config } from "@fosscord/util";
-import { HTTPError } from "@fosscord/util";
+import { Config, HTTPError } from "@fosscord/util";
+import { Request, Response, Router } from "express";
+import fetch from "node-fetch";
+import ProxyAgent from "proxy-agent";
 
 const router = Router();
 
@@ -34,7 +33,7 @@ router.get("/", route({}), async (req: Request, res: Response) => {
 	const { media_format, locale } = req.query;
 
 	const apiKey = getGifApiKey();
-	
+
 	const agent = new ProxyAgent();
 
 	const [responseSource, trendGifSource] = await Promise.all([
@@ -50,8 +49,8 @@ router.get("/", route({}), async (req: Request, res: Response) => {
 		})
 	]);
 
-	const { tags } = await responseSource.json() as any;
-	const { results } = await trendGifSource.json() as any;
+	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 })),