From 482a0fb5fc248b1ec61db35299dc3e6d963ad5ab Mon Sep 17 00:00:00 2001 From: Poornima Date: Sun, 12 Mar 2017 04:10:56 +0530 Subject: Adding functionality to get & delete incoming webhooks (#5648) --- api4/context.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'api4/context.go') diff --git a/api4/context.go b/api4/context.go index c30a975f2..f9460f53b 100644 --- a/api4/context.go +++ b/api4/context.go @@ -455,3 +455,15 @@ func (c *Context) RequirePreferenceName() *Context { return c } + +func (c *Context) RequireHookId() *Context { + if c.Err != nil { + return c + } + + if len(c.Params.HookId) != 26 { + c.SetInvalidUrlParam("hook_id") + } + + return c +} -- cgit v1.2.3-1-g7c22