From 43fa7e05489e46bc42ae4ed4123c4bda020058a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 9 Apr 2019 11:55:39 +0200 Subject: [PATCH] Adding the client part of the new endpoint to invalidate email invites (#10561) --- model/client4.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/model/client4.go b/model/client4.go index 3622c85310..84ee8f5fac 100644 --- a/model/client4.go +++ b/model/client4.go @@ -1771,6 +1771,16 @@ func (c *Client4) InviteUsersToTeam(teamId string, userEmails []string) (bool, * return CheckStatusOK(r), BuildResponse(r) } +// InvalidateEmailInvites will invalidate active email invitations that have not been accepted by the user. +func (c *Client4) InvalidateEmailInvites() (bool, *Response) { + r, err := c.DoApiDelete(c.GetTeamsRoute() + "/invites/email") + if err != nil { + return false, BuildErrorResponse(r, err) + } + defer closeBody(r) + return CheckStatusOK(r), BuildResponse(r) +} + // GetTeamInviteInfo returns a team object from an invite id containing sanitized information. func (c *Client4) GetTeamInviteInfo(inviteId string) (*Team, *Response) { r, err := c.DoApiGet(c.GetTeamsRoute()+"/invite/"+inviteId, "")