Skip to content

Commit

Permalink
Merge pull request #197 from webitel/fix/saving-condition-in-slas
Browse files Browse the repository at this point in the history
fix: saving condition in slas[WTEL-5687](https://webitel.atlassian.ne…
  • Loading branch information
Lera24 authored Dec 16, 2024
2 parents a018924 + 3ebe87f commit b4aee20
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,28 @@ const resetTableState = {
const resetCardState = {
itemId: '',
itemInstance: {
id: '',
name: '',
priorities: [],
reactionTime: 0,
resolutionTime: 0,
slaId: 0,
},
};

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,
Expand All @@ -47,6 +62,7 @@ const table = createTableStoreModule({
const card = createCardStoreModule({
state: { _resettable: resetCardState },
getters,
actions,
modules: {
api,
},
Expand Down

0 comments on commit b4aee20

Please sign in to comment.