feat: Set up store for teams (#1689)

This commit is contained in:
Nithin David Thomas
2021-03-15 18:35:56 +05:30
committed by GitHub
parent cadb246eaa
commit 941d4219f0
26 changed files with 1168 additions and 4 deletions

View File

@@ -46,6 +46,20 @@ export const actions = {
commit(SET_TEAM_MEMBERS_UI_FLAG, { isCreating: false });
}
},
update: async ({ commit }, { agentsList, teamId }) => {
commit(SET_TEAM_MEMBERS_UI_FLAG, { isUpdating: true });
try {
const response = await TeamsAPI.updateAgents({
agentsList,
teamId,
});
commit(ADD_AGENTS_TO_TEAM, response);
} catch (error) {
throw new Error(error);
} finally {
commit(SET_TEAM_MEMBERS_UI_FLAG, { isUpdating: false });
}
},
};
export const mutations = {