From d29ccaf623910eea90852fa28cd8ec191bd7afff Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Thu, 2 Sep 2021 19:50:05 +0200 Subject: :sparkles: add user_id field to Member --- api/src/routes/users/#id/profile.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'api/src/routes/users/#id') diff --git a/api/src/routes/users/#id/profile.ts b/api/src/routes/users/#id/profile.ts index afccfed5..8be03b47 100644 --- a/api/src/routes/users/#id/profile.ts +++ b/api/src/routes/users/#id/profile.ts @@ -1,9 +1,10 @@ import { Router, Request, Response } from "express"; -import { User } from "../../../../../util/dist"; +import { PublicConnectedAccount, PublicUser, User, UserPublic } from "../../../../../util/dist"; const router: Router = Router(); router.get("/", async (req: Request, res: Response) => { + if (req.params.id === "@me") req.params.id = req.user_id; const user = await User.getPublicUser(req.params.id, { relations: ["connected_accounts"] }); res.json({ @@ -24,4 +25,11 @@ router.get("/", async (req: Request, res: Response) => { }); }); +export interface UserProfileResponse { + user: UserPublic; + connected_accounts: PublicConnectedAccount; + premium_guild_since?: Date; + premium_since?: Date; +} + export default router; -- cgit 1.4.1