Skip to content
Snippets Groups Projects
Commit 5675bad8 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

fix feature import from geojson not working

parent 65b923af
No related branches found
No related tags found
2 merge requests!295Version 3.0.0,!282REDMINE_ISSUE-12779
......@@ -165,7 +165,7 @@ const feature_type = {
});
},
async SEND_FEATURES_FROM_GEOJSON({ state, dispatch, rootGetters }, payload) {
async SEND_FEATURES_FROM_GEOJSON({ state, dispatch, rootState }, payload) {
let { feature_type_slug, geojson } = payload;
//* check if geojson then build a file
if(!geojson && !state.fileToImport && state.fileToImport.size === 0 ) return;
......@@ -173,7 +173,7 @@ const feature_type = {
let fileToImport;
const { name, type } = geojson || state.fileToImport;
if (!rootGetters['projects/project'].moderation) {
if (rootState.projects.project.moderation) {
if (state.fileToImport && state.fileToImport.size > 0) { //* if data in a binary file, read it as text
const textFile = await state.fileToImport.text();
geojson = JSON.parse(textFile);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment