diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-02 19:50:05 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-02 19:50:05 +0200 |
commit | d29ccaf623910eea90852fa28cd8ec191bd7afff (patch) | |
tree | 040af2cced2548560403efb72be4d026f41908f9 /api/src/routes/users/#id | |
parent | :art: update openapi title (diff) | |
download | server-d29ccaf623910eea90852fa28cd8ec191bd7afff.tar.xz |
:sparkles: add user_id field to Member
Diffstat (limited to 'api/src/routes/users/#id')
-rw-r--r-- | api/src/routes/users/#id/profile.ts | 10 |
1 files changed, 9 insertions, 1 deletions
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; |