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 @@
-

Add Member

-
-
- -
- -
- -
-
-

Add Role

@@ -140,24 +127,6 @@ members = res.data; } - async function addUser() { - const res = await axios.put(`${API_URL}/api/${guildId}/team/${activeTeam}/${selectedUser.id}?type=0`); - if (res.status !== 200) { - notifyError(res.data.error); - return; - } - - notifySuccess(`${selectedUser.username} has been added to the support team ${getTeam(activeTeam).name}`); - - let entity = { - id: selectedUser.id, - type: 0, - name: `${selectedUser.username}` - } - members = [...members, entity]; - selectedUser = undefined; - } - async function addRole() { const res = await axios.put(`${API_URL}/api/${guildId}/team/${activeTeam}/${selectedRole.id}?type=1`); if (res.status !== 200) {