From 95f78b3643e84707298490a322eee760059b5031 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sun, 17 Nov 2019 18:02:48 -0500 Subject: [PATCH] add storage information route --- src/api/routes/Account.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/api/routes/Account.ts b/src/api/routes/Account.ts index 6240f3d..a676310 100644 --- a/src/api/routes/Account.ts +++ b/src/api/routes/Account.ts @@ -44,5 +44,14 @@ export default class Account extends Route { this.handleError(error, res); } }); + + this.router.get('/storage', async (req: Req, res) => { + try { + const data = await this.server.client.redis.get(`storage-${req.account.username}`) ? await this.server.client.redis.get(`storage-${req.account.username}`) : null; + res.status(200).json({ code: this.constants.codes.SUCCESS, message: data }); + } catch (error) { + this.handleError(error, res); + } + }); } }