From a3f5cffd4693446eecdc6f88ed336a4c35c1e708 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Sat, 8 Apr 2017 02:06:09 +0900 Subject: APIv4 PUT /commands/{command_id} (#5999) * APIv4 PUT /commands/{command_id} * update client parameter and api4 test --- api4/context.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'api4/context.go') diff --git a/api4/context.go b/api4/context.go index 36a48eb9d..9c27ec9c1 100644 --- a/api4/context.go +++ b/api4/context.go @@ -477,3 +477,14 @@ func (c *Context) RequireHookId() *Context { return c } + +func (c *Context) RequireCommandId() *Context { + if c.Err != nil { + return c + } + + if len(c.Params.CommandId) != 26 { + c.SetInvalidUrlParam("command_id") + } + return c +} -- cgit v1.2.3-1-g7c22