Fixed mutations #162

This commit is contained in:
Sven Heidemann 2023-02-08 19:24:07 +01:00
parent e9559dec08
commit b33c5dc9bf
7 changed files with 21 additions and 19 deletions

View File

@ -28,8 +28,8 @@ type AutoRoleMutation {
} }
input AutoRoleInput { input AutoRoleInput {
id: ID! id: ID
channelId: String! channelId: String
messageId: String! messageId: String
serverId: ID! serverId: ID
} }

View File

@ -25,8 +25,8 @@ type AutoRoleRuleMutation {
} }
input AutoRoleRuleInput { input AutoRoleRuleInput {
id: ID! id: ID
emojiName: String! emojiName: String
roleId: String! roleId: String
autoRoleId: ID! autoRoleId: ID
} }

View File

@ -25,9 +25,9 @@ type LevelMutation {
input LevelInput { input LevelInput {
id: ID id: ID
name: String! name: String
color: String! color: String
minXp: Int! minXp: Int
permissions: String! permissions: String
serverId: ID! serverId: ID
} }

View File

@ -33,6 +33,6 @@ type UserMutation {
} }
input UserInput { input UserInput {
id: ID! id: ID
xp: Int! xp: Int
} }

View File

@ -35,7 +35,7 @@ class AutoRoleMutation(QueryABC):
and x.discord_message_id == input["messageId"] and x.discord_message_id == input["messageId"]
) )
return self._auto_roles.get_auto_roles_by_server_id(auto_role.server.server_id).where(get_new) return self._auto_roles.get_auto_roles_by_server_id(auto_role.server.server_id).where(get_new).last()
def resolve_update_auto_role(self, *_, input: dict): def resolve_update_auto_role(self, *_, input: dict):
auto_role = self._auto_roles.get_auto_role_by_id(input["id"]) auto_role = self._auto_roles.get_auto_role_by_id(input["id"])

View File

@ -37,8 +37,10 @@ class AutoRoleRuleMutation(QueryABC):
and x.role_id == input["roleId"] and x.role_id == input["roleId"]
) )
return self._auto_roles.get_auto_role_rules_by_auto_role_id(auto_role_rule.auto_role.auto_role_id).where( return (
get_new self._auto_roles.get_auto_role_rules_by_auto_role_id(auto_role_rule.auto_role.auto_role_id)
.where(get_new)
.last()
) )
def resolve_update_auto_role_rule(self, *_, input: dict): def resolve_update_auto_role_rule(self, *_, input: dict):

View File

@ -42,7 +42,7 @@ class LevelMutation(QueryABC):
and l.permissions == level.permissions and l.permissions == level.permissions
) )
return self._levels.get_levels_by_server_id(level.server.server_id).where(get_new_level) return self._levels.get_levels_by_server_id(level.server.server_id).where(get_new_level).last()
def resolve_update_level(self, *_, input: dict): def resolve_update_level(self, *_, input: dict):
level = self._levels.get_level_by_id(input["id"]) level = self._levels.get_level_by_id(input["id"])