From 139711b0127d600e3230562eee04c901f1dde93c Mon Sep 17 00:00:00 2001 From: cgoodwin90 Date: Wed, 11 Oct 2023 15:11:12 +1100 Subject: [PATCH 1/2] Renames and updates addGroupToOrganization resolvers --- services/api/src/resolvers.js | 5 +++-- services/api/src/resources/organization/resolvers.ts | 4 ++-- services/api/src/typeDefs.js | 4 ++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/services/api/src/resolvers.js b/services/api/src/resolvers.js index 42ad902c79..f8b8781203 100644 --- a/services/api/src/resolvers.js +++ b/services/api/src/resolvers.js @@ -259,7 +259,7 @@ const { getGroupsByNameAndOrganizationId, getOwnersByOrganizationId, getProjectsByOrganizationId, - addProjectToOrganization, + addExistingProjectToOrganization, removeProjectFromOrganization, addExistingGroupToOrganization, getGroupsByOrganizationsProject, @@ -708,7 +708,8 @@ const resolvers = { deleteOrganization, addGroupToOrganization: addGroup, addExistingGroupToOrganization, - addProjectToOrganization, + addProjectToOrganization: addProject, + addExistingProjectToOrganization, removeProjectFromOrganization, addDeployTargetToOrganization, removeDeployTargetFromOrganization, diff --git a/services/api/src/resources/organization/resolvers.ts b/services/api/src/resources/organization/resolvers.ts index 09b50ef4f1..9c03e2108e 100644 --- a/services/api/src/resources/organization/resolvers.ts +++ b/services/api/src/resources/organization/resolvers.ts @@ -720,7 +720,7 @@ export const removeProjectFromOrganization: ResolverFn = async ( } // add existing project to an organization -export const addProjectToOrganization: ResolverFn = async ( +export const addExistingProjectToOrganization: ResolverFn = async ( root, { input }, { sqlClientPool, hasPermission, userActivityLogger, models, keycloakGroups } @@ -784,7 +784,7 @@ export const addProjectToOrganization: ResolverFn = async ( userActivityLogger(`User added a project to organization`, { project: '', organization: input.organization, - event: 'api:addProjectToOrganization', + event: 'api:addExistingProjectToOrganization', payload: { data: { project: pid, diff --git a/services/api/src/typeDefs.js b/services/api/src/typeDefs.js index c54805b1ee..e387586cc3 100644 --- a/services/api/src/typeDefs.js +++ b/services/api/src/typeDefs.js @@ -2431,6 +2431,10 @@ const typeDefs = gql` """ addExistingGroupToOrganization(input: AddGroupToOrganizationInput!): OrgGroupInterface """ + Add an existing project to an organization + """ + addExistingProjectToOrganization(input: AddProjectToOrganizationInput): Project + """ Add a project to an organization, will return an error if it can't easily do it """ addProjectToOrganization(input: AddProjectToOrganizationInput): Project From 1aace13f7d8a4fa99ae425981a1a8dfb6c431621 Mon Sep 17 00:00:00 2001 From: cgoodwin90 Date: Wed, 11 Oct 2023 16:20:10 +1100 Subject: [PATCH 2/2] Rename to addExistingProjectToOrganization --- services/api/src/resolvers.js | 1 - services/api/src/typeDefs.js | 4 ---- 2 files changed, 5 deletions(-) diff --git a/services/api/src/resolvers.js b/services/api/src/resolvers.js index f8b8781203..84d641d039 100644 --- a/services/api/src/resolvers.js +++ b/services/api/src/resolvers.js @@ -708,7 +708,6 @@ const resolvers = { deleteOrganization, addGroupToOrganization: addGroup, addExistingGroupToOrganization, - addProjectToOrganization: addProject, addExistingProjectToOrganization, removeProjectFromOrganization, addDeployTargetToOrganization, diff --git a/services/api/src/typeDefs.js b/services/api/src/typeDefs.js index e387586cc3..47f08cd0cd 100644 --- a/services/api/src/typeDefs.js +++ b/services/api/src/typeDefs.js @@ -2435,10 +2435,6 @@ const typeDefs = gql` """ addExistingProjectToOrganization(input: AddProjectToOrganizationInput): Project """ - Add a project to an organization, will return an error if it can't easily do it - """ - addProjectToOrganization(input: AddProjectToOrganizationInput): Project - """ Remove a project from an organization, this will return the project to a state where it has no groups or notifications associated to it """ removeProjectFromOrganization(input: RemoveProjectFromOrganizationInput): Project