From c55b49b34db2ff41217c76e8c414f5a9fcd0944f Mon Sep 17 00:00:00 2001 From: Hugo Tiburtino <45924645+hugotiburtino@users.noreply.github.com> Date: Tue, 29 Oct 2024 20:16:03 +0100 Subject: [PATCH] fix(user-add-role): fix deadloack by not creating role if it doesnt exist --- packages/server/src/schema/uuid/user/resolvers.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/packages/server/src/schema/uuid/user/resolvers.ts b/packages/server/src/schema/uuid/user/resolvers.ts index d98707e66..e7d206d7a 100644 --- a/packages/server/src/schema/uuid/user/resolvers.ts +++ b/packages/server/src/schema/uuid/user/resolvers.ts @@ -320,18 +320,6 @@ export const resolvers: Resolvers = { if (id == null) { throw new UserInputError('no user with given username') } - await database.mutate( - ` - INSERT INTO role (name) - SELECT ? - WHERE NOT EXISTS ( - SELECT 1 - FROM role - WHERE name = ? - ) - `, - [generateRole(role, instance), generateRole(role, instance)], - ) await database.mutate( `