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/@me/guilds.ts | |
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/@me/guilds.ts')
-rw-r--r-- | api/src/routes/users/@me/guilds.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/routes/users/@me/guilds.ts b/api/src/routes/users/@me/guilds.ts index fb88281b..1edb0eb1 100644 --- a/api/src/routes/users/@me/guilds.ts +++ b/api/src/routes/users/@me/guilds.ts @@ -6,7 +6,7 @@ import { In } from "typeorm"; const router: Router = Router(); router.get("/", async (req: Request, res: Response) => { - const members = await Member.find({ relations: ["guild"], where: { id: req.user_id } }); + const members = await Member.find({ relations: ["guild"], where: { user_id: req.user_id } }); res.json(members.map((x) => x.guild)); }); @@ -20,7 +20,7 @@ router.delete("/:id", async (req: Request, res: Response) => { if (guild.owner_id === req.user_id) throw new HTTPError("You can't leave your own guild", 400); await Promise.all([ - Member.delete({ id: req.user_id, guild_id: guild_id }), + Member.delete({ user_id: req.user_id, guild_id: guild_id }), emitEvent({ event: "GUILD_DELETE", data: { |