Adding edit of incoming webhook (#5272)

Adding edit of outgoing webhook
Fixing spelling of error
Fixing style
Changing from PUT to POST for updates
Fixing test failures due to merge
Этот коммит содержится в:
Poornima
2017-02-27 00:18:20 +05:30
коммит произвёл Joram Wilander
родитель c0bb6f99f8
Коммит 19b753467d
35 изменённых файлов: 1939 добавлений и 763 удалений

Просмотреть файл

@@ -107,6 +107,27 @@ func (s SqlWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) StoreChann
return storeChannel
}
func (s SqlWebhookStore) UpdateIncoming(hook *model.IncomingWebhook) StoreChannel {
storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
hook.UpdateAt = model.GetMillis()
if _, err := s.GetMaster().Update(hook); err != nil {
result.Err = model.NewLocAppError("SqlWebhookStore.UpdateIncoming", "store.sql_webhooks.update_incoming.app_error", nil, "id="+hook.Id+", "+err.Error())
} else {
result.Data = hook
}
storeChannel <- result
close(storeChannel)
}()
return storeChannel
}
func (s SqlWebhookStore) GetIncoming(id string, allowFromCache bool) StoreChannel {
storeChannel := make(StoreChannel, 1)