diff options
Diffstat (limited to 'apps/workflowengine/src')
-rw-r--r-- | apps/workflowengine/src/helpers/api.js | 4 | ||||
-rw-r--r-- | apps/workflowengine/src/store.js | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/apps/workflowengine/src/helpers/api.js b/apps/workflowengine/src/helpers/api.js index a6dc3a3d03a..2b2bb40a7e2 100644 --- a/apps/workflowengine/src/helpers/api.js +++ b/apps/workflowengine/src/helpers/api.js @@ -20,8 +20,10 @@ * */ +import { loadState } from '@nextcloud/initial-state' + const getApiUrl = (url) => { - const scopeValue = OCP.InitialState.loadState('workflowengine', 'scope') === 0 ? 'global' : 'user' + const scopeValue = loadState('workflowengine', 'scope') === 0 ? 'global' : 'user' return OC.linkToOCS('apps/workflowengine/api/v1/workflows', 2) + scopeValue + url + '?format=json' } diff --git a/apps/workflowengine/src/store.js b/apps/workflowengine/src/store.js index 41e170c0541..cbd9b29c81c 100644 --- a/apps/workflowengine/src/store.js +++ b/apps/workflowengine/src/store.js @@ -25,22 +25,23 @@ import Vuex from 'vuex' import axios from '@nextcloud/axios' import { getApiUrl } from './helpers/api' import confirmPassword from 'nextcloud-password-confirmation' +import { loadState } from '@nextcloud/initial-state' Vue.use(Vuex) const store = new Vuex.Store({ state: { rules: [], - scope: OCP.InitialState.loadState('workflowengine', 'scope'), - operations: OCP.InitialState.loadState('workflowengine', 'operators'), + scope: loadState('workflowengine', 'scope'), + operations: loadState('workflowengine', 'operators'), plugins: Vue.observable({ checks: {}, operators: {} }), - entities: OCP.InitialState.loadState('workflowengine', 'entities'), - events: OCP.InitialState.loadState('workflowengine', 'entities') + entities: loadState('workflowengine', 'entities'), + events: loadState('workflowengine', 'entities') .map((entity) => entity.events.map(event => { return { id: `${entity.id}::${event.eventName}`, @@ -48,7 +49,7 @@ const store = new Vuex.Store({ ...event } })).flat(), - checks: OCP.InitialState.loadState('workflowengine', 'checks') + checks: loadState('workflowengine', 'checks') }, mutations: { addRule(state, rule) { |