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:
Vishnu Narayanan
2024-03-15 12:21:32 +05:30
committed by GitHub
parent 58ee2e125a
commit 29e44ac6d0
4 changed files with 62 additions and 84 deletions

View File

@@ -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 {