mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
add output when creating webhooks with the CLI (#10139)
* add output when creating webhooks with the CLI * update per feedback * update per feedback
This commit is contained in:
committed by
Christopher Speller
parent
6d733e35f7
commit
244e1a5a7a
@@ -156,10 +156,14 @@ func createIncomingWebhookCmdF(command *cobra.Command, args []string) error {
|
||||
ChannelLocked: channelLocked,
|
||||
}
|
||||
|
||||
if _, err := app.CreateIncomingWebhookForChannel(user.Id, channel, incomingWebhook); err != nil {
|
||||
return err
|
||||
createdIncoming, errIncomingWebhook := app.CreateIncomingWebhookForChannel(user.Id, channel, incomingWebhook)
|
||||
if errIncomingWebhook != nil {
|
||||
return errIncomingWebhook
|
||||
}
|
||||
|
||||
CommandPrettyPrintln("Id: " + createdIncoming.Id)
|
||||
CommandPrettyPrintln("Display Name: " + createdIncoming.DisplayName)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -287,10 +291,14 @@ func createOutgoingWebhookCmdF(command *cobra.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := app.CreateOutgoingWebhook(outgoingWebhook); err != nil {
|
||||
return err
|
||||
createdOutgoing, errOutgoing := app.CreateOutgoingWebhook(outgoingWebhook)
|
||||
if errOutgoing != nil {
|
||||
return errOutgoing
|
||||
}
|
||||
|
||||
CommandPrettyPrintln("Id: " + createdOutgoing.Id)
|
||||
CommandPrettyPrintln("Display Name: " + createdOutgoing.DisplayName)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user