diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-04 11:26:47 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-09-04 11:26:47 +0200 |
commit | 2e9f36b66ad99140fe1312a8b2bdfaf7b0e9d6bb (patch) | |
tree | fcd3733bf36327c988c95892d548d4e5d628f505 /api/src/routes/guilds | |
parent | :bug: api member add roles -> make sure that roles exist (diff) | |
parent | fixed /discoverable-guilds (diff) | |
download | server-2e9f36b66ad99140fe1312a8b2bdfaf7b0e9d6bb.tar.xz |
Merge branch 'master' of https://github.com/fosscord/fosscord-api
Diffstat (limited to 'api/src/routes/guilds')
-rw-r--r-- | api/src/routes/guilds/#guild_id/members/#member_id/index.ts | 3 | ||||
-rw-r--r-- | api/src/routes/guilds/#guild_id/roles.ts | 2 | ||||
-rw-r--r-- | api/src/routes/guilds/index.ts | 2 | ||||
-rw-r--r-- | api/src/routes/guilds/templates/index.ts | 2 |
4 files changed, 5 insertions, 4 deletions
diff --git a/api/src/routes/guilds/#guild_id/members/#member_id/index.ts b/api/src/routes/guilds/#guild_id/members/#member_id/index.ts index 51bb010d..0d62e555 100644 --- a/api/src/routes/guilds/#guild_id/members/#member_id/index.ts +++ b/api/src/routes/guilds/#guild_id/members/#member_id/index.ts @@ -50,7 +50,8 @@ router.patch("/", check(MemberChangeSchema), async (req: Request, res: Response) }); router.put("/", async (req: Request, res: Response) => { - const { guild_id, member_id } = req.params; + let { guild_id, member_id } = req.params; + if (member_id === "@me") member_id = req.user_id; throw new HTTPError("Maintenance: Currently you can't add a member", 403); // TODO: only for oauth2 applications diff --git a/api/src/routes/guilds/#guild_id/roles.ts b/api/src/routes/guilds/#guild_id/roles.ts index bdfc370e..6a318688 100644 --- a/api/src/routes/guilds/#guild_id/roles.ts +++ b/api/src/routes/guilds/#guild_id/roles.ts @@ -14,7 +14,7 @@ import { HTTPError } from "lambert-server"; import { check } from "../../../util/instanceOf"; import { RoleModifySchema, RolePositionUpdateSchema } from "../../../schema/Roles"; -import { DiscordApiErrors } from "../../../util/Constants"; +import { DiscordApiErrors } from "@fosscord/util"; import { In } from "typeorm"; const router: Router = Router(); diff --git a/api/src/routes/guilds/index.ts b/api/src/routes/guilds/index.ts index 7c0b7abc..e5830647 100644 --- a/api/src/routes/guilds/index.ts +++ b/api/src/routes/guilds/index.ts @@ -3,7 +3,7 @@ import { Role, Guild, Snowflake, Config, User, Member, Channel } from "@fosscord import { HTTPError } from "lambert-server"; import { check } from "./../../util/instanceOf"; import { GuildCreateSchema } from "../../schema/Guild"; -import { DiscordApiErrors } from "../../util/Constants"; +import { DiscordApiErrors } from "@fosscord/util"; const router: Router = Router(); diff --git a/api/src/routes/guilds/templates/index.ts b/api/src/routes/guilds/templates/index.ts index 3a619278..58201f65 100644 --- a/api/src/routes/guilds/templates/index.ts +++ b/api/src/routes/guilds/templates/index.ts @@ -4,7 +4,7 @@ import { Template, Guild, Role, Snowflake, Config, User, Member } from "@fosscor import { HTTPError } from "lambert-server"; import { GuildTemplateCreateSchema } from "../../../schema/Guild"; import { check } from "../../../util/instanceOf"; -import { DiscordApiErrors } from "../../../util/Constants"; +import { DiscordApiErrors } from "@fosscord/util"; router.get("/:code", async (req: Request, res: Response) => { const { code } = req.params; |