Skip to content

Commit

Permalink
fix: Updated input definition to avoid duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui committed Sep 6, 2023
1 parent 0f8af63 commit df7d0bf
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions src/storyMap/storyMapService.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,20 +148,8 @@ export const deleteStoryMap = ({ storyMap }) => {

export const addMemberships = ({ storyMap, emails, userRole }) => {
const query = graphql(`
mutation addMemberships(
$storyMapId: String!
$storyMapSlug: String!
$userEmails: [String!]!
$userRole: String!
) {
saveStoryMapMembership(
input: {
storyMapId: $storyMapId
storyMapSlug: $storyMapSlug
userEmails: $userEmails
userRole: $userRole
}
) {
mutation addMemberships($input: StoryMapMembershipSaveMutationInput!) {
saveStoryMapMembership(input: $input) {
memberships {
...collaborationMembershipFields
}
Expand All @@ -172,10 +160,12 @@ export const addMemberships = ({ storyMap, emails, userRole }) => {

return terrasoApi
.requestGraphQL(query, {
storyMapId: storyMap.storyMapId,
storyMapSlug: storyMap.slug,
userEmails: emails,
userRole,
input: {
storyMapId: storyMap.storyMapId,
storyMapSlug: storyMap.slug,
userEmails: emails,
userRole,
},
})
.then(_.get('saveStoryMapMembership.memberships'))
.then(response =>
Expand Down

0 comments on commit df7d0bf

Please sign in to comment.