From 3ebe87f8a856e096b8917ae7e405c21c66c7a1e4 Mon Sep 17 00:00:00 2001 From: Lera24 Date: Mon, 16 Dec 2024 20:02:45 +0200 Subject: [PATCH] fix: saving condition in slas[WTEL-5687](https://webitel.atlassian.net/browse/WTEL-5687) --- .../components/opened-sla-condition-popup.vue | 2 +- .../slas/modules/conditions/store/conditions.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/components/opened-sla-condition-popup.vue b/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/components/opened-sla-condition-popup.vue index 30420eed..71525544 100644 --- a/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/components/opened-sla-condition-popup.vue +++ b/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/components/opened-sla-condition-popup.vue @@ -92,7 +92,7 @@ const { const conditionId = computed(() => route.params.conditionId); const isNew = computed(() => conditionId.value === 'new'); -const { close } = useClose( `${CrmSections.SLAS}-conditions`); +const { close } = useClose(`${CrmSections.SLAS}-conditions`); function loadDataList() { emit('load-data'); diff --git a/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/store/conditions.js b/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/store/conditions.js index ddfe6b16..2f69e5ee 100644 --- a/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/store/conditions.js +++ b/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/store/conditions.js @@ -19,6 +19,12 @@ const resetTableState = { const resetCardState = { itemId: '', itemInstance: { + id: '', + name: '', + priorities: [], + reactionTime: 0, + resolutionTime: 0, + slaId: 0, }, }; @@ -26,6 +32,15 @@ const getters = { PARENT_ID: (s, g, rootState) => rootState.configuration.lookups.slas.card.itemId, }; +const actions = { + ADD_ITEM: async (context) => { + await context.dispatch('api/POST_ITEM', { context }); + }, + UPDATE_ITEM: async (context) => { + await context.dispatch('api/UPD_ITEM', { context }); + }, +} + const api = createApiStoreModule({ state: { api: ConditionsAPI, @@ -47,6 +62,7 @@ const table = createTableStoreModule({ const card = createCardStoreModule({ state: { _resettable: resetCardState }, getters, + actions, modules: { api, },