const moduleDefault = {
  state: {
    tags: [],
    availableCustomFields: []
  },
  mutations: {
    setTags (state, payload) {
      state.tags = payload
    },
    setAvailableCustomFields (state, payload) {
      state.availableCustomFields = payload
    }
  },
  getters: {
    getTagsByList: (state) => (list) => {
      return state.tags.filter(t => t.listCode === list);
    },
    getAvailableCustomFieldsByList: (state) => (list) => {
      return state.availableCustomFields.filter(t => t.documentName === list);
    }
  }
}

export default moduleDefault