From 2e6fd031d15a9502e7a7a4536febfe49780c0697 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 20 Jun 2017 09:55:43 -0400 Subject: Add GET /teams/invite/{invite_id} endpoint for v4 (#6685) --- 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 7a908c588..35f343b7a 100644 --- a/api4/context.go +++ b/api4/context.go @@ -350,6 +350,17 @@ func (c *Context) RequireTeamId() *Context { return c } +func (c *Context) RequireInviteId() *Context { + if c.Err != nil { + return c + } + + if len(c.Params.InviteId) != 26 { + c.SetInvalidUrlParam("invite_id") + } + return c +} + func (c *Context) RequireChannelId() *Context { if c.Err != nil { return c -- cgit v1.2.3-1-g7c22