chore: Use camel case

This commit is contained in:
iamsivin
2024-11-07 10:32:38 +05:30
parent 4b85a9045a
commit 314a33e053
9 changed files with 114 additions and 89 deletions
@@ -77,7 +77,7 @@ export const getters = {
},
getAllConversationsByContactId: $state => id => {
const records = $state.records[Number(id)] || [];
return camelcaseKeys(records);
return camelcaseKeys(records, { deep: true });
},
};
@@ -1,3 +1,5 @@
import camelcaseKeys from 'camelcase-keys';
export const getters = {
getContacts($state) {
return $state.sortOrder.map(contactId => $state.records[contactId]);
@@ -9,6 +11,10 @@ export const getters = {
const contact = $state.records[id];
return contact || {};
},
getContactById: $state => id => {
const contact = $state.records[id];
return camelcaseKeys(contact || {});
},
getMeta: $state => {
return $state.meta;
},
@@ -7,6 +7,7 @@ import FBChannel from '../../api/channel/fbChannel';
import TwilioChannel from '../../api/channel/twilioChannel';
import { throwErrorMessage } from '../utils/api';
import AnalyticsHelper from '../../helper/AnalyticsHelper';
import camelcaseKeys from 'camelcase-keys';
import { ACCOUNT_EVENTS } from '../../helper/AnalyticsHelper/events';
const buildInboxData = inboxParams => {
@@ -92,6 +93,12 @@ export const getters = {
);
return inbox || {};
},
getInboxById: $state => inboxId => {
const [inbox] = $state.records.filter(
record => record.id === Number(inboxId)
);
return camelcaseKeys(inbox || {}, { deep: true });
},
getUIFlags($state) {
return $state.uiFlags;
},