diff client/src/store/imports.js @ 1350:58d41573e530

staging: now with real data from backend
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 26 Nov 2018 14:42:48 +0100
parents eda98694e678
children da7ee82ad5d6
line wrap: on
line diff
--- a/client/src/store/imports.js	Mon Nov 26 12:53:15 2018 +0100
+++ b/client/src/store/imports.js	Mon Nov 26 14:42:48 2018 +0100
@@ -40,12 +40,15 @@
       state.imports = imports;
     },
     setStaging: (state, staging) => {
-      state.staging = staging;
+      const enriched = staging.map(x => {
+        return { ...x, status: STATES.NEEDSAPPROVAL };
+      });
+      state.staging = enriched;
     },
 
     toggleApproval: (state, change) => {
       const { id, newStatus } = change;
-      const stagedResult = this.state.staging.find(e => {
+      const stagedResult = state.staging.find(e => {
         return e.id === id;
       });
       if (stagedResult.status === newStatus) {