feat: add option to delete and disable edits for SLA (#9108)
* feat: add delete button for SLA * chore: remove edit SLA * chore: remove update related texts from i18n
This commit is contained in:
@@ -50,16 +50,16 @@ export const actions = {
|
||||
}
|
||||
},
|
||||
|
||||
update: async function update({ commit }, { id, ...updateObj }) {
|
||||
commit(types.SET_SLA_UI_FLAG, { isUpdating: true });
|
||||
delete: async function deleteSla({ commit }, id) {
|
||||
commit(types.SET_SLA_UI_FLAG, { isDeleting: true });
|
||||
try {
|
||||
const response = await SlaAPI.update(id, updateObj);
|
||||
AnalyticsHelper.track(SLA_EVENTS.UPDATE);
|
||||
commit(types.EDIT_SLA, response.data.payload);
|
||||
await SlaAPI.delete(id);
|
||||
AnalyticsHelper.track(SLA_EVENTS.DELETED);
|
||||
commit(types.DELETE_SLA, id);
|
||||
} catch (error) {
|
||||
throwErrorMessage(error);
|
||||
} finally {
|
||||
commit(types.SET_SLA_UI_FLAG, { isUpdating: false });
|
||||
commit(types.SET_SLA_UI_FLAG, { isDeleting: false });
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -74,7 +74,7 @@ export const mutations = {
|
||||
|
||||
[types.SET_SLA]: MutationHelpers.set,
|
||||
[types.ADD_SLA]: MutationHelpers.create,
|
||||
[types.EDIT_SLA]: MutationHelpers.update,
|
||||
[types.DELETE_SLA]: MutationHelpers.destroy,
|
||||
};
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user