Merge pull request #1149 from mattermost/plt-808
PLT-808 Fix deleting channels breaking the webhook UI
Этот коммит содержится в:
@@ -137,6 +137,27 @@ func (s SqlWebhookStore) GetIncomingByUser(userId string) StoreChannel {
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetIncomingByChannel(channelId string) StoreChannel {
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
go func() {
|
||||
result := StoreResult{}
|
||||
|
||||
var webhooks []*model.IncomingWebhook
|
||||
|
||||
if _, err := s.GetReplica().Select(&webhooks, "SELECT * FROM IncomingWebhooks WHERE ChannelId = :ChannelId AND DeleteAt = 0", map[string]interface{}{"ChannelId": channelId}); err != nil {
|
||||
result.Err = model.NewAppError("SqlWebhookStore.GetIncomingByChannel", "We couldn't get the webhooks", "channelId="+channelId+", err="+err.Error())
|
||||
}
|
||||
|
||||
result.Data = webhooks
|
||||
|
||||
storeChannel <- result
|
||||
close(storeChannel)
|
||||
}()
|
||||
|
||||
return storeChannel
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) StoreChannel {
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
|
||||
@@ -150,6 +150,7 @@ type WebhookStore interface {
|
||||
SaveIncoming(webhook *model.IncomingWebhook) StoreChannel
|
||||
GetIncoming(id string) StoreChannel
|
||||
GetIncomingByUser(userId string) StoreChannel
|
||||
GetIncomingByChannel(channelId string) StoreChannel
|
||||
DeleteIncoming(webhookId string, time int64) StoreChannel
|
||||
SaveOutgoing(webhook *model.OutgoingWebhook) StoreChannel
|
||||
GetOutgoing(id string) StoreChannel
|
||||
|
||||
Ссылка в новой задаче
Block a user