Chatwoot/app/javascript/dashboard/store/modules/contacts/getters.js
Fayaz Ahmed d7cfe6858e
feat: Add advanced contact filters (#3471)
Co-authored-by: Tejaswini <tejaswini@chatwoot.com>
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2021-12-02 19:12:44 -08:00

18 lines
419 B
JavaScript

export const getters = {
getContacts($state) {
return $state.sortOrder.map(contactId => $state.records[contactId]);
},
getUIFlags($state) {
return $state.uiFlags;
},
getContact: $state => id => {
const contact = $state.records[id];
return contact || {};
},
getMeta: $state => {
return $state.meta;
},
getAppliedContactFilters: _state => {
return _state.appliedFilters;
},
};