diff options
Diffstat (limited to 'api4/context.go')
-rw-r--r-- | api4/context.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/api4/context.go b/api4/context.go index 69351a098..e95e29991 100644 --- a/api4/context.go +++ b/api4/context.go @@ -586,3 +586,14 @@ func (c *Context) RequireJobType() *Context { } return c } + +func (c *Context) RequireActionId() *Context { + if c.Err != nil { + return c + } + + if len(c.Params.ActionId) != 26 { + c.SetInvalidUrlParam("action_id") + } + return c +} |