Skip to content

Commit

Permalink
refactor(cli): create Microsoft Teams alert channels via APIv2
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <[email protected]>
  • Loading branch information
afiune committed Oct 11, 2021
1 parent 57b318e commit 74372b8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cli/cmd/integration_microsoft_teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ func createMicrosoftTeamsChannelIntegration() error {
return err
}

teams := api.NewMicrosoftTeamsAlertChannel(answers.Name,
api.MicrosoftTeamsChannelData{
WebhookURL: answers.WebhookUrl,
teams := api.NewAlertChannel(answers.Name,
api.MicrosoftTeamsAlertChannelType,
api.MicrosoftTeamsData{
TeamsUrl: answers.WebhookUrl,
},
)

cli.StartProgress(" Creating integration...")
_, err = cli.LwApi.Integrations.CreateMicrosoftTeamsAlertChannel(teams)
_, err = cli.LwApi.V2.AlertChannels.Create(teams)
cli.StopProgress()
return err
}

0 comments on commit 74372b8

Please sign in to comment.