Feat: Rename postes.yml to config.yml and consequences in vuex
This commit is contained in:
parent
6ddd661ae3
commit
3e36c2a444
@ -7,7 +7,7 @@ export default {
|
|||||||
state: {
|
state: {
|
||||||
data_dir: '/home/lafrite/scripts/comptes/data/',
|
data_dir: '/home/lafrite/scripts/comptes/data/',
|
||||||
config_dir: '/home/lafrite/scripts/comptes/config/',
|
config_dir: '/home/lafrite/scripts/comptes/config/',
|
||||||
postes_filename: 'postes.yml',
|
config_filename: 'config.yml',
|
||||||
postes: {}
|
postes: {}
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
@ -17,8 +17,8 @@ export default {
|
|||||||
config_dir: (state) => {
|
config_dir: (state) => {
|
||||||
return state.config_dir
|
return state.config_dir
|
||||||
},
|
},
|
||||||
postes_filename: (state) => {
|
config_filename: (state) => {
|
||||||
return state.postes_filename
|
return state.config_filename
|
||||||
},
|
},
|
||||||
postes: (state) => {
|
postes: (state) => {
|
||||||
return state.postes
|
return state.postes
|
||||||
@ -30,8 +30,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
load_postes (context) {
|
load(context) {
|
||||||
readFile(path.join(context.getters.config_dir, context.getters.postes_filename), 'utf8', (err, content) => {
|
readFile(path.join(context.getters.config_dir, context.getters.config_filename), 'utf8', (err, content) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
} else {
|
} else {
|
||||||
|
@ -55,7 +55,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted: function () {
|
mounted: function () {
|
||||||
this.$store.dispatch('config/load_postes')
|
this.$store.dispatch('config/load')
|
||||||
this.$store.dispatch('datas/find_csv')
|
this.$store.dispatch('datas/find_csv')
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
Loading…
Reference in New Issue
Block a user