Mercurial > gemma
comparison client/src/store/imports.js @ 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 | 90211725e4a9 |
children | aec17976528e |
comparison
equal
deleted
inserted
replaced
1708:49e047c2106e | 1709:8ff8d873ef6b |
---|---|
80 stagedResult.status = newStatus; | 80 stagedResult.status = newStatus; |
81 } | 81 } |
82 } | 82 } |
83 }, | 83 }, |
84 actions: { | 84 actions: { |
85 getSchedules({ commit }) { | 85 triggerImport({ commit }, { type, data }) { |
86 throw new Error("Not Implemented!"); | |
87 return new Promise((resolve, reject) => { | 86 return new Promise((resolve, reject) => { |
88 HTTP.get("/imports", { | 87 HTTP.post("imports/" + type, data, { |
89 headers: { "X-Gemma-Auth": localStorage.getItem("token") } | 88 headers: { |
89 "X-Gemma-Auth": localStorage.getItem("token") | |
90 } | |
90 }) | 91 }) |
91 .then(response => { | 92 .then(response => { |
92 commit("setImports", response.data.imports); | |
93 resolve(response); | 93 resolve(response); |
94 }) | 94 }) |
95 .catch(error => { | 95 .catch(error => { |
96 reject(error); | 96 reject(error); |
97 }); | 97 }); |