Commit ea818389 authored by Daniel Schalla's avatar Daniel Schalla

[MM-13671] Add RegenerateTeamInviteId Action and Client Method (#803)

* Add new Client action to regenerate Invite ID

* Update src/action_types/teams.js
Co-Authored-By: default avatarDSchalla <daniel@schalla.me>

* Update src/actions/teams.js
Co-Authored-By: default avatarDSchalla <daniel@schalla.me>
parent baff2964
......@@ -37,6 +37,7 @@ export default keyMirror({
SELECT_TEAM: null,
UPDATED_TEAM: null,
PATCHED_TEAM: null,
REGENERATED_TEAM_INVITE_ID: null,
RECEIVED_TEAM: null,
RECEIVED_TEAMS: null,
RECEIVED_TEAM_DELETED: null,
......
......@@ -208,6 +208,16 @@ export function patchTeam(team: Team): ActionFunc {
});
}
export function regenerateTeamInviteId(teamId: string): ActionFunc {
return bindClientFunc({
clientFunc: Client4.regenerateTeamInviteId,
onSuccess: TeamTypes.REGENERATED_TEAM_INVITE_ID,
params: [
teamId,
],
});
}
export function getMyTeamMembers(): ActionFunc {
return async (dispatch: DispatchFunc, getState: GetStateFunc) => {
const getMyTeamMembersFunc = bindClientFunc({
......
......@@ -882,6 +882,15 @@ export default class Client4 {
);
};
regenerateTeamInviteId = async (teamId) => {
this.trackEvent('api', 'api_teams_regenerate_invite_id', {team_id: teamId});
return this.doFetch(
`${this.getTeamRoute(teamId)}/regenerate_invite_id`,
{method: 'post'}
);
};
updateTeamScheme = async (teamId, schemeId) => {
const patch = {scheme_id: schemeId};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment