feat: Add custom attribute table (#2929)
This commit is contained in:
@@ -14,18 +14,18 @@ export const getters = {
|
||||
getUIFlags(_state) {
|
||||
return _state.uiFlags;
|
||||
},
|
||||
getAttributes: _state => attributeType => {
|
||||
getAttributesByModel: _state => attributeModel => {
|
||||
return _state.records.filter(
|
||||
record => record.attribute_display_type === attributeType
|
||||
record => record.attribute_model === attributeModel
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const actions = {
|
||||
get: async function getAttributes({ commit }) {
|
||||
get: async function getAttributesByModel({ commit }, modelId) {
|
||||
commit(types.SET_CUSTOM_ATTRIBUTE_UI_FLAG, { isFetching: true });
|
||||
try {
|
||||
const response = await AttributeAPI.get();
|
||||
const response = await AttributeAPI.getAttributesByModel(modelId);
|
||||
commit(types.SET_CUSTOM_ATTRIBUTE, response.data);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
|
||||
Reference in New Issue
Block a user