From 3357fa2d41a4093b147e82739a28ceb176771237 Mon Sep 17 00:00:00 2001 From: rxdn <29165304+rxdn@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:03:54 +0100 Subject: [PATCH] Only add roles to teams --- app/http/endpoints/api/team/addmember.go | 5 ++++ frontend/src/views/Teams.svelte | 31 ------------------------ 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/app/http/endpoints/api/team/addmember.go b/app/http/endpoints/api/team/addmember.go index dfa0a04..153a259 100644 --- a/app/http/endpoints/api/team/addmember.go +++ b/app/http/endpoints/api/team/addmember.go @@ -29,6 +29,11 @@ func AddMember(ctx *gin.Context) { return } + if entityType == entityTypeUser { + ctx.JSON(400, utils.ErrorStr("Only roles may be added as support representatives")) + return + } + if entityType == entityTypeRole && snowflake == guildId { ctx.JSON(400, utils.ErrorStr("You cannot add the @everyone role as staff")) return diff --git a/frontend/src/views/Teams.svelte b/frontend/src/views/Teams.svelte index 25060e7..bd48bee 100644 --- a/frontend/src/views/Teams.svelte +++ b/frontend/src/views/Teams.svelte @@ -58,19 +58,6 @@