MCPcopy Create free account
hub / github.com/bugy/script-server / init

Function init

web-src/src/admin/store/scripts-module.js:10–23  ·  view source on GitHub ↗
({commit})

Source from the content-addressed store, hash-verified

8 namespaced: true,
9 actions: {
10 init({commit}) {
11 commit('SET_LOADING', true);
12
13 axiosInstance.get('scripts', {params: {mode: 'edit'}}).then(({data}) => {
14 const {scripts} = data;
15 let scriptConfigs = scripts.map(s => ({name: s.name, parsingFailed: s.parsing_failed}));
16 scriptConfigs.sort(function (e1, e2) {
17 return e1.name.toLowerCase().localeCompare(e2.name.toLowerCase());
18 });
19
20 commit('SET_SCRIPTS', scriptConfigs);
21 commit('SET_LOADING', false);
22 })
23 }
24 },
25 mutations: {
26 SET_LOADING(state, loading) {

Callers

nothing calls this directly

Calls 2

mapMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected