diff client/src/components/importschedule/Importscheduledetail.vue @ 1709:8ff8d873ef6b

refac: trigger manual import via store
author Thomas Junk <thomas.junk@intevation.de>
date Tue, 08 Jan 2019 13:59:47 +0100
parents 74b66527ae81
children aec17976528e
line wrap: on
line diff
--- a/client/src/components/importschedule/Importscheduledetail.vue	Tue Jan 08 13:35:44 2019 +0100
+++ b/client/src/components/importschedule/Importscheduledetail.vue	Tue Jan 08 13:59:47 2019 +0100
@@ -302,7 +302,6 @@
 import { mapState } from "vuex";
 import { displayInfo, displayError } from "@/lib/errors.js";
 import app from "@/main.js";
-import { HTTP } from "@/lib/http.js";
 
 export default {
   name: "importscheduledetail",
@@ -453,11 +452,9 @@
         BOTTLENECK: "bottleneck"
       };
       this.triggerActive = false;
-      HTTP.post("imports/" + importTypes[this.import_], data, {
-        headers: {
-          "X-Gemma-Auth": localStorage.getItem("token")
-        }
-      })
+      const type = importTypes[this.import_];
+      this.$store
+        .dispatch("imports/triggerImport", { type, data })
         .then(response => {
           const { id } = response.data;
           displayInfo({