From 61883371403c6e99ff7b0ec6b34987c7a63143d2 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 9 Aug 2021 09:17:11 +0200 Subject: [PATCH] Fix: remove useless state --- src/store/travail/index.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/store/travail/index.js b/src/store/travail/index.js index 61cd4ba..4224efe 100644 --- a/src/store/travail/index.js +++ b/src/store/travail/index.js @@ -102,11 +102,11 @@ const travail = { getMonth: (state) => (date) => { return state.months[date] }, - count: (state, getters) => { + count: (getters) => { // Amount of mounts return Object.keys(getters.months).length }, - ca: (state, getters) => { + ca: (getters) => { // Total CA (ca_react if sets, ca_retro otherwise) return Object.values(getters.months).map(a => monthCA(a)).reduce( (acc, v) => acc + v, @@ -120,28 +120,28 @@ const travail = { 0 ) / getters.count) }, - caTheo: (state, getters) => { + caTheo: (getters) => { // Total theorical CA return Object.values(getters.months).map(a => a.ca_theo).reduce( (acc, v) => acc + v, 0 ) }, - remuneration: (state, getters) => { + remuneration: (getters) => { // Total remuneration return Object.values(getters.months).map(a => a.remuneration).reduce( (acc, v) => acc + v, 0 ) }, - remunerationMean: (state, getters) => { + remunerationMean: (getters) => { // Mean of remuneration return Math.floor(Object.values(getters.months).map(a => a.remuneration).reduce( (acc, v) => acc + v, 0 ) / getters.count) }, - retrocession: (state, getters) => { + retrocession: (getters) => { // Total retrocession return Object.values(getters.months) .map(a => a.retro) @@ -150,7 +150,7 @@ const travail = { 0 ) }, - retrocessionMean: (state, getters) => { + retrocessionMean: (getters) => { // Mean of retrocession return Math.floor( Object.values(getters.months) @@ -185,9 +185,7 @@ const travail = { createMonth(context, { date, month }) { // Create a new month if (!(date in context.state.months)) { - console.log(date) context.commit('createMonth', { date, month }) - console.log(context.state.months) } else { console.log("This month already exists") }