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

chore: Cleanup Mattermost API #10465

Merged
merged 1 commit into from
Nov 12, 2024
Merged
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
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
Loading