Feat: Rename postes.yml to config.yml and consequences in vuex

This commit is contained in:
Bertrand Benjamin 2018-12-02 18:02:44 +01:00
parent a3a1055c90
commit 4c7523dbb8
3 changed files with 6 additions and 6 deletions

View File

@ -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 {

View File

@ -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: {