fix: Welcome email copy changes and canned response API error handling [cw-1290] (#6905)

* fix: Welcome email copy changes and canned response API error handling

* Review fixes

* Uses mixin for alerts in canned page

* Typo fixes

* Copy changes

* Fixes broken tests

* Fixes review comments

* Fixes typo errors with mail template

* Removes unwanted case

* Fixes repetitive texts

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Nithin David Thomas
2023-05-10 15:55:48 +05:30
committed by GitHub
parent 520bdabefe
commit 07aaa046c1
7 changed files with 42 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
import { throwErrorMessage } from 'dashboard/store/utils/api';
import * as MutationHelpers from 'shared/helpers/vuex/mutationHelpers';
import * as types from '../mutation-types';
import CannedResponseAPI from '../../api/cannedResponse';
@@ -46,8 +47,10 @@ const actions = {
const response = await CannedResponseAPI.create(cannedObj);
commit(types.default.ADD_CANNED, response.data);
commit(types.default.SET_CANNED_UI_FLAG, { creatingItem: false });
return response.data;
} catch (error) {
commit(types.default.SET_CANNED_UI_FLAG, { creatingItem: false });
return throwErrorMessage(error);
}
},
@@ -60,8 +63,10 @@ const actions = {
const response = await CannedResponseAPI.update(id, updateObj);
commit(types.default.EDIT_CANNED, response.data);
commit(types.default.SET_CANNED_UI_FLAG, { updatingItem: false });
return response.data;
} catch (error) {
commit(types.default.SET_CANNED_UI_FLAG, { updatingItem: false });
return throwErrorMessage(error);
}
},
@@ -71,8 +76,10 @@ const actions = {
await CannedResponseAPI.delete(id);
commit(types.default.DELETE_CANNED, id);
commit(types.default.SET_CANNED_UI_FLAG, { deletingItem: true });
return id;
} catch (error) {
commit(types.default.SET_CANNED_UI_FLAG, { deletingItem: true });
return throwErrorMessage(error);
}
},
};