fix: Update the relevant agent presence only (#5220)

This commit is contained in:
Pranav Raj S
2022-08-09 12:32:09 +05:30
committed by GitHub
parent cbcee6414c
commit 657bd44418
11 changed files with 100 additions and 62 deletions

View File

@@ -45,6 +45,16 @@ export const updatePresence = (state, data) => {
});
};
export const updateSingleRecordPresence = (
records,
{ id, availabilityStatus }
) => {
const [selectedRecord] = records.filter(record => record.id === Number(id));
if (selectedRecord) {
Vue.set(selectedRecord, 'availability_status', availabilityStatus);
}
};
export const destroy = (state, id) => {
state.records = state.records.filter(record => record.id !== id);
};