feat: Contact Exports (#7258)

This commit is contained in:
Tejaswini Chile
2023-06-13 09:18:43 +05:30
committed by GitHub
parent 429ec7194f
commit 23ca6d56f9
16 changed files with 240 additions and 0 deletions

View File

@@ -140,6 +140,20 @@ export const actions = {
}
},
export: async ({ commit }) => {
try {
await ContactAPI.exportContacts();
commit(types.SET_CONTACT_UI_FLAG, { isCreating: false });
} catch (error) {
commit(types.SET_CONTACT_UI_FLAG, { isCreating: false });
if (error.response?.data?.message) {
throw new Error(error.response.data.message);
} else {
throw new Error(error);
}
}
},
delete: async ({ commit }, id) => {
commit(types.SET_CONTACT_UI_FLAG, { isDeleting: true });
try {