Feature: Availability Statuses (#874)

Co-authored-by: Pranav Raj S <pranav@thoughtwoot.com>
This commit is contained in:
Sojan Jose 2020-07-04 11:42:47 +05:30 committed by GitHub
parent bd87927576
commit c98907db49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 413 additions and 77 deletions

View file

@ -34,6 +34,17 @@ export const updateAttributes = (state, data) => {
});
};
export const updatePresence = (state, data) => {
state.records.forEach((element, index) => {
const availabilityStatus = data[element.id];
if (availabilityStatus) {
Vue.set(state.records[index], 'availability_status', availabilityStatus);
} else {
Vue.delete(state.records[index], 'availability_status');
}
});
};
export const destroy = (state, id) => {
state.records = state.records.filter(record => record.id !== id);
};