mirror of
https://github.com/lingble/chatwoot.git
synced 2025-12-28 00:25:15 +00:00
Fixes https://github.com/chatwoot/chatwoot/issues/8436 Fixes https://github.com/chatwoot/chatwoot/issues/9767 Fixes https://github.com/chatwoot/chatwoot/issues/10156 Fixes https://github.com/chatwoot/chatwoot/issues/6031 Fixes https://github.com/chatwoot/chatwoot/issues/5696 Fixes https://github.com/chatwoot/chatwoot/issues/9250 Fixes https://github.com/chatwoot/chatwoot/issues/9762 --------- Co-authored-by: Pranav <pranavrajs@gmail.com> Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
55 lines
1.0 KiB
JavaScript
55 lines
1.0 KiB
JavaScript
import {
|
|
SET_TEAM_UI_FLAG,
|
|
CLEAR_TEAMS,
|
|
SET_TEAMS,
|
|
SET_TEAM_ITEM,
|
|
EDIT_TEAM,
|
|
DELETE_TEAM,
|
|
} from './types';
|
|
|
|
export const mutations = {
|
|
[SET_TEAM_UI_FLAG]($state, data) {
|
|
$state.uiFlags = {
|
|
...$state.uiFlags,
|
|
...data,
|
|
};
|
|
},
|
|
|
|
[CLEAR_TEAMS]: $state => {
|
|
$state.records = {};
|
|
},
|
|
|
|
[SET_TEAMS]: ($state, data) => {
|
|
const updatedRecords = { ...$state.records };
|
|
data.forEach(team => {
|
|
updatedRecords[team.id] = {
|
|
...(updatedRecords[team.id] || {}),
|
|
...team,
|
|
};
|
|
});
|
|
$state.records = updatedRecords;
|
|
},
|
|
|
|
[SET_TEAM_ITEM]: ($state, data) => {
|
|
$state.records = {
|
|
...$state.records,
|
|
[data.id]: {
|
|
...($state.records[data.id] || {}),
|
|
...data,
|
|
},
|
|
};
|
|
},
|
|
|
|
[EDIT_TEAM]: ($state, data) => {
|
|
$state.records = {
|
|
...$state.records,
|
|
[data.id]: data,
|
|
};
|
|
},
|
|
|
|
[DELETE_TEAM]: ($state, teamId) => {
|
|
const { [teamId]: toDelete, ...records } = $state.records;
|
|
$state.records = records;
|
|
},
|
|
};
|