chore: Update the usage with camel case

This commit is contained in:
iamsivin
2024-11-07 20:46:29 +05:30
parent 314a33e053
commit c5974f97cd
8 changed files with 67 additions and 37 deletions
@@ -1,6 +1,7 @@
import * as MutationHelpers from 'shared/helpers/vuex/mutationHelpers';
import types from '../mutation-types';
import AttributeAPI from '../../api/attributes';
import camelcaseKeys from 'camelcase-keys';
export const state = {
records: [],
@@ -24,6 +25,12 @@ export const getters = {
record => record.attribute_model === attributeModel
);
},
getAttributesByModelType: _state => attributeModel => {
const records = _state.records.filter(
record => record.attribute_model === attributeModel
);
return camelcaseKeys(records, { deep: true });
},
};
export const actions = {