summaryrefslogtreecommitdiffstats
path: root/api4/context.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-06-20 09:55:43 -0400
committerGeorge Goldberg <george@gberg.me>2017-06-20 14:55:43 +0100
commit2e6fd031d15a9502e7a7a4536febfe49780c0697 (patch)
tree644ad924de6ac441eee9f941683a6f92859229b6 /api4/context.go
parenteffaeee830efa78cd15218f6ba3920031ff8a5c1 (diff)
downloadchat-2e6fd031d15a9502e7a7a4536febfe49780c0697.tar.gz
chat-2e6fd031d15a9502e7a7a4536febfe49780c0697.tar.bz2
chat-2e6fd031d15a9502e7a7a4536febfe49780c0697.zip
Add GET /teams/invite/{invite_id} endpoint for v4 (#6685)
Diffstat (limited to 'api4/context.go')
-rw-r--r--api4/context.go11
1 files changed, 11 insertions, 0 deletions
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