Skip to content

Commit

Permalink
feat(supportGroup): add mutations for add/remove user (#72)
Browse files Browse the repository at this point in the history
Co-authored-by: David Rochow <[email protected]>
  • Loading branch information
MR2011 and drochow authored Jul 16, 2024
1 parent 09243f1 commit 66631e6
Show file tree
Hide file tree
Showing 14 changed files with 1,063 additions and 0 deletions.
220 changes: 220 additions & 0 deletions internal/api/graphql/graph/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

mutation ($supportGroupId: ID!, $userId: ID!) {
addUserToSupportGroup (
supportGroupId: $supportGroupId,
userId: $userId
) {
id
users {
edges {
node {
id
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company and Greenhouse contributors
# SPDX-License-Identifier: Apache-2.0

mutation ($supportGroupId: ID!, $userId: ID!) {
removeUserFromSupportGroup (
userId: $userId,
supportGroupId: $supportGroupId
) {
id
users {
edges {
node {
id
}
}
}
}
}
44 changes: 44 additions & 0 deletions internal/api/graphql/graph/resolver/mutation.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions internal/api/graphql/graph/schema/mutation.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ type Mutation {
deleteSupportGroup(id: ID!): String!
addServiceToSupportGroup(supportGroupId: ID!, serviceId: ID!): SupportGroup!
removeServiceFromSupportGroup(supportGroupId: ID!, serviceId: ID!): SupportGroup!
addUserToSupportGroup(supportGroupId: ID!, userId: ID!): SupportGroup!
removeUserFromSupportGroup(supportGroupId: ID!, userId: ID!): SupportGroup!

createComponent(input: ComponentInput!): Component!
updateComponent(id: ID!, input: ComponentInput!): Component!
Expand Down
2 changes: 2 additions & 0 deletions internal/app/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ type Heureka interface {
DeleteSupportGroup(int64) error
AddServiceToSupportGroup(int64, int64) (*entity.SupportGroup, error)
RemoveServiceFromSupportGroup(int64, int64) (*entity.SupportGroup, error)
AddUserToSupportGroup(int64, int64) (*entity.SupportGroup, error)
RemoveUserFromSupportGroup(int64, int64) (*entity.SupportGroup, error)

ListComponentInstances(*entity.ComponentInstanceFilter, *entity.ListOptions) (*entity.List[entity.ComponentInstanceResult], error)
CreateComponentInstance(*entity.ComponentInstance) (*entity.ComponentInstance, error)
Expand Down
Loading

0 comments on commit 66631e6

Please sign in to comment.