import { getPageListData } from '@/api/main/system/system';
import { buildTrie } from '@/utils/trie';
const useKeysStore = defineStore('keys', {
  state: () => ({
    knowledgeKeys: [],
  }),
  actions: {
    async setKeysTire() {
      const knowledgeKeysResult = await getPageListData('/km/doc/GetDcoKeywords');
      this.knowledgeKeys = buildTrie(knowledgeKeysResult.data ?? []);
    },
  },
});

export default useKeysStore;
