Skip to content

Commit

Permalink
chore: Cleanup Mattermost API (#10465)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dschoordsch authored Nov 12, 2024
1 parent 7fbab74 commit b2adfaa
Showing 1 changed file with 23 additions and 27 deletions.
50 changes: 23 additions & 27 deletions packages/server/integrations/mattermost/mattermostWebhookHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,26 @@ const eventLookup: Record<
convertInput?: (input: any) => any
}
> = {
teams: {
query: gql`
query Teams {
viewer {
teams {
id
name
orgId
teamMembers {
id
email
}
}
}
}
`,
convertResult: (data: any) => {
return data.viewer.teams
}
},
meetingTemplates: {
query: gql`
query MeetingTemplates {
Expand All @@ -48,35 +68,11 @@ const eventLookup: Record<
}
}
}
teams {
id
name
orgId
retroSettings: meetingSettings(meetingType: retrospective) {
id
phaseTypes
... on RetrospectiveMeetingSettings {
disableAnonymity
}
}
pokerSettings: meetingSettings(meetingType: poker) {
id
phaseTypes
}
actionSettings: meetingSettings(meetingType: action) {
id
phaseTypes
}
}
}
}
`,
convertResult: (data: any) => {
const restructured = {
availableTemplates: data.viewer.availableTemplates.edges.map((edge: any) => edge.node),
teams: data.viewer.teams
}
return restructured
return data.viewer.availableTemplates.edges.map((edge: any) => edge.node)
}
},
startRetrospective: {
Expand Down Expand Up @@ -156,7 +152,7 @@ const eventLookup: Record<
}
`
},
getMeetingSettings: {
meetingSettings: {
query: gql`
query GetMeetingSettings($teamId: ID!, $meetingType: MeetingTypeEnum!) {
viewer {
Expand Down Expand Up @@ -216,7 +212,7 @@ const eventLookup: Record<
}
}
},
getActiveMeetings: {
activeMeetings: {
query: gql`
query Meetings {
viewer {
Expand Down

0 comments on commit b2adfaa

Please sign in to comment.