diff options
Diffstat (limited to 'api/webhook.go')
-rw-r--r-- | api/webhook.go | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/api/webhook.go b/api/webhook.go index 284563ddd..a9a88b7b8 100644 --- a/api/webhook.go +++ b/api/webhook.go @@ -41,8 +41,8 @@ func createIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) { return } - cchan := Srv.Store.Channel().Get(c.T, hook.ChannelId) - pchan := Srv.Store.Channel().CheckPermissionsTo(c.T, c.Session.TeamId, hook.ChannelId, c.Session.UserId) + cchan := Srv.Store.Channel().Get(hook.ChannelId) + pchan := Srv.Store.Channel().CheckPermissionsTo(c.Session.TeamId, hook.ChannelId, c.Session.UserId) hook.UserId = c.Session.UserId hook.TeamId = c.Session.TeamId @@ -62,7 +62,7 @@ func createIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) { } } - if result := <-Srv.Store.Webhook().SaveIncoming(c.T, hook); result.Err != nil { + if result := <-Srv.Store.Webhook().SaveIncoming(hook); result.Err != nil { c.Err = result.Err return } else { @@ -89,7 +89,7 @@ func deleteIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) { return } - if result := <-Srv.Store.Webhook().GetIncoming(c.T, id); result.Err != nil { + if result := <-Srv.Store.Webhook().GetIncoming(id); result.Err != nil { c.Err = result.Err return } else { @@ -100,7 +100,7 @@ func deleteIncomingHook(c *Context, w http.ResponseWriter, r *http.Request) { } } - if err := (<-Srv.Store.Webhook().DeleteIncoming(c.T, id, model.GetMillis())).Err; err != nil { + if err := (<-Srv.Store.Webhook().DeleteIncoming(id, model.GetMillis())).Err; err != nil { c.Err = err return } @@ -116,7 +116,7 @@ func getIncomingHooks(c *Context, w http.ResponseWriter, r *http.Request) { return } - if result := <-Srv.Store.Webhook().GetIncomingByUser(c.T, c.Session.UserId); result.Err != nil { + if result := <-Srv.Store.Webhook().GetIncomingByUser(c.Session.UserId); result.Err != nil { c.Err = result.Err return } else { @@ -145,8 +145,8 @@ func createOutgoingHook(c *Context, w http.ResponseWriter, r *http.Request) { hook.TeamId = c.Session.TeamId if len(hook.ChannelId) != 0 { - cchan := Srv.Store.Channel().Get(c.T, hook.ChannelId) - pchan := Srv.Store.Channel().CheckPermissionsTo(c.T, c.Session.TeamId, hook.ChannelId, c.Session.UserId) + cchan := Srv.Store.Channel().Get(hook.ChannelId) + pchan := Srv.Store.Channel().CheckPermissionsTo(c.Session.TeamId, hook.ChannelId, c.Session.UserId) var channel *model.Channel if result := <-cchan; result.Err != nil { @@ -171,7 +171,7 @@ func createOutgoingHook(c *Context, w http.ResponseWriter, r *http.Request) { return } - if result := <-Srv.Store.Webhook().SaveOutgoing(c.T, hook); result.Err != nil { + if result := <-Srv.Store.Webhook().SaveOutgoing(hook); result.Err != nil { c.Err = result.Err return } else { @@ -188,7 +188,7 @@ func getOutgoingHooks(c *Context, w http.ResponseWriter, r *http.Request) { return } - if result := <-Srv.Store.Webhook().GetOutgoingByCreator(c.T, c.Session.UserId); result.Err != nil { + if result := <-Srv.Store.Webhook().GetOutgoingByCreator(c.Session.UserId); result.Err != nil { c.Err = result.Err return } else { @@ -214,7 +214,7 @@ func deleteOutgoingHook(c *Context, w http.ResponseWriter, r *http.Request) { return } - if result := <-Srv.Store.Webhook().GetOutgoing(c.T, id); result.Err != nil { + if result := <-Srv.Store.Webhook().GetOutgoing(id); result.Err != nil { c.Err = result.Err return } else { @@ -225,7 +225,7 @@ func deleteOutgoingHook(c *Context, w http.ResponseWriter, r *http.Request) { } } - if err := (<-Srv.Store.Webhook().DeleteOutgoing(c.T, id, model.GetMillis())).Err; err != nil { + if err := (<-Srv.Store.Webhook().DeleteOutgoing(id, model.GetMillis())).Err; err != nil { c.Err = err return } @@ -252,7 +252,7 @@ func regenOutgoingHookToken(c *Context, w http.ResponseWriter, r *http.Request) } var hook *model.OutgoingWebhook - if result := <-Srv.Store.Webhook().GetOutgoing(c.T, id); result.Err != nil { + if result := <-Srv.Store.Webhook().GetOutgoing(id); result.Err != nil { c.Err = result.Err return } else { @@ -267,7 +267,7 @@ func regenOutgoingHookToken(c *Context, w http.ResponseWriter, r *http.Request) hook.Token = model.NewId() - if result := <-Srv.Store.Webhook().UpdateOutgoing(c.T, hook); result.Err != nil { + if result := <-Srv.Store.Webhook().UpdateOutgoing(hook); result.Err != nil { c.Err = result.Err return } else { |