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

Function init

web-src/src/admin/store/script-config-module.js:42–57  ·  view source on GitHub ↗
({commit, state}, scriptName)

Source from the content-addressed store, hash-verified

40 namespaced: true,
41 actions: {
42 init({commit, state}, scriptName) {
43 if (scriptName === NEW_SCRIPT) {
44 commit('INIT_NEW_SCRIPT');
45 return;
46 }
47
48 commit('RESET', scriptName);
49
50 axiosInstance.get('admin/scripts/' + encodeURIComponent(scriptName))
51 .then(({data}) => {
52 commit('SET_SCRIPT_CONFIG', {config: data.config, filename: data.filename});
53 })
54 .catch((error) => {
55 commit('SET_LOAD_ERROR', 'Failed to load script config')
56 });
57 },
58
59 save({dispatch, state}) {
60 const oldName = state.scriptName;

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected