Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(supportGroup): add mutations for add/remove user #72

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading