feat: Clone automation rules (#3893)

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Fayaz Ahmed 2022-02-03 09:14:22 +05:30 committed by GitHub
parent 8821106da9
commit fc1f257793
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 26 deletions

View file

@ -66,6 +66,16 @@ export const actions = {
commit(types.SET_AUTOMATION_UI_FLAG, { isDeleting: false });
}
},
clone: async ({ commit }, id) => {
commit(types.SET_AUTOMATION_UI_FLAG, { isCloning: true });
try {
await AutomationAPI.clone(id);
} catch (error) {
throw new Error(error);
} finally {
commit(types.SET_AUTOMATION_UI_FLAG, { isCloning: false });
}
},
};
export const mutations = {