Feat: write data on edit

This commit is contained in:
2021-08-09 11:48:24 +02:00
parent 899fd95dbd
commit 5020479b0a
4 changed files with 11 additions and 4 deletions

View File

@@ -183,11 +183,11 @@ const travail = {
},
loadMonths (context) {
// import all months from storage
readFile(context.rootGetters["config/dataFilePath"], (err, data) => {
if (err) throw err;
const months = Papa.parse(data.toString(), {header: true, dynamicTyping:true})
.data.reduce(
const months = Papa.parse(data.toString(), {header: true, dynamicTyping:true, skipEmptyLines:true})
.data
.reduce(
(acc, el) => {
acc[el.date] = el;
return acc