From 4c7523dbb8dc7f477d939dfe9e5d6e9f565da533 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Sun, 2 Dec 2018 18:02:44 +0100 Subject: [PATCH] Feat: Rename postes.yml to config.yml and consequences in vuex --- config/{postes.yml => config.yml} | 0 src/store/modules/config.js | 10 +++++----- src/views/home.vue | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename config/{postes.yml => config.yml} (100%) diff --git a/config/postes.yml b/config/config.yml similarity index 100% rename from config/postes.yml rename to config/config.yml diff --git a/src/store/modules/config.js b/src/store/modules/config.js index be1ed6f..063244e 100644 --- a/src/store/modules/config.js +++ b/src/store/modules/config.js @@ -7,7 +7,7 @@ export default { state: { data_dir: '/home/lafrite/scripts/comptes/data/', config_dir: '/home/lafrite/scripts/comptes/config/', - postes_filename: 'postes.yml', + config_filename: 'config.yml', postes: {} }, getters: { @@ -17,8 +17,8 @@ export default { config_dir: (state) => { return state.config_dir }, - postes_filename: (state) => { - return state.postes_filename + config_filename: (state) => { + return state.config_filename }, postes: (state) => { return state.postes @@ -30,8 +30,8 @@ export default { } }, actions: { - load_postes (context) { - readFile(path.join(context.getters.config_dir, context.getters.postes_filename), 'utf8', (err, content) => { + load(context) { + readFile(path.join(context.getters.config_dir, context.getters.config_filename), 'utf8', (err, content) => { if (err) { console.log(err) } else { diff --git a/src/views/home.vue b/src/views/home.vue index 96842cf..3f751eb 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -59,7 +59,7 @@ export default { } }, mounted: function () { - this.$store.dispatch('config/load_postes') + this.$store.dispatch('config/load') this.$store.dispatch('datas/find_csv') }, computed: {