diff options
author | fenn-cs <fenn25.fn@gmail.com> | 2024-02-19 11:23:28 +0100 |
---|---|---|
committer | fenn-cs <fenn25.fn@gmail.com> | 2024-03-06 02:05:51 +0100 |
commit | 647f4bc1c8c92fd41c8e98555da0cd0aee817a54 (patch) | |
tree | b724a57431fd51316a6ac476be4cf0bdd0f633a8 /core/src/store | |
parent | d35a49caba0ec1b8ff2857b77b9471ea53076838 (diff) | |
download | nextcloud-server-647f4bc1c8c92fd41c8e98555da0cd0aee817a54.tar.gz nextcloud-server-647f4bc1c8c92fd41c8e98555da0cd0aee817a54.zip |
refactor: migrate from vuex to pinia
Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
Diffstat (limited to 'core/src/store')
-rw-r--r-- | core/src/store/index.js | 11 | ||||
-rw-r--r-- | core/src/store/unified-search-external-filters.js | 30 |
2 files changed, 12 insertions, 29 deletions
diff --git a/core/src/store/index.js b/core/src/store/index.js deleted file mode 100644 index d263a5dc407..00000000000 --- a/core/src/store/index.js +++ /dev/null @@ -1,11 +0,0 @@ -import Vue from 'vue'; -import Vuex from 'vuex'; -import search from './unified-search-external-filters'; - -Vue.use(Vuex); - -export default new Vuex.Store({ - modules: { - search, - }, -}); diff --git a/core/src/store/unified-search-external-filters.js b/core/src/store/unified-search-external-filters.js index 45d0f4c7090..3a8cd2aca2d 100644 --- a/core/src/store/unified-search-external-filters.js +++ b/core/src/store/unified-search-external-filters.js @@ -19,24 +19,18 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ -const state = { - externalFilters: [], -} +import { defineStore } from 'pinia' -const mutations = { - registerExternalFilter(state, { id, label, callback, icon }) { - state.externalFilters.push({ id, name: label, callback, icon, isPluginFilter: true }) - }, -} +export const useSearchStore = defineStore({ + id: 'search', -const actions = { - registerExternalFilter({ commit }, { id, label, callback, icon }) { - commit('registerExternalFilter', { id, label, callback, icon }) - }, -} + state: () => ({ + externalFilters: [], + }), -export default { - state, - mutations, - actions, -} + actions: { + registerExternalFilter({ id, appId, label, callback, icon }) { + this.externalFilters.push({ id, appId, name: label, callback, icon, isPluginFilter: true }) + }, + }, +}) |