From 644e9c6629453b07844ca83fab7fbe9a3185b4b6 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 30 Apr 2021 18:38:26 -0500 Subject: add "basic" url parameter to /player/ --- build/index.js | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/index.js b/build/index.js index 2d7ab25..0a6944c 100644 --- a/build/index.js +++ b/build/index.js @@ -31,7 +31,7 @@ app.get('/', async (req, res) => { res.json({ ok: true }); }); app.get('/player/:user', async (req, res) => { - res.json(await hypixel_1.fetchUser({ user: req.params.user }, ['profiles', 'player'])); + res.json(await hypixel_1.fetchUser({ user: req.params.user }, [req.query.basic === 'true' ? undefined : 'profiles', 'player'])); }); app.get('/player/:user/:profile', async (req, res) => { res.json(await hypixel_1.fetchMemberProfile(req.params.user, req.params.profile)); diff --git a/src/index.ts b/src/index.ts index 1e641a1..06bdc5f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -33,7 +33,7 @@ app.get('/player/:user', async(req, res) => { res.json( await fetchUser( { user: req.params.user }, - ['profiles', 'player'] + [req.query.basic as string === 'true' ? undefined : 'profiles', 'player'] ) ) }) -- cgit