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
No related merge requests found
...@@ -165,7 +165,7 @@ const feature_type = { ...@@ -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; let { feature_type_slug, geojson } = payload;
//* check if geojson then build a file //* check if geojson then build a file
if(!geojson && !state.fileToImport && state.fileToImport.size === 0 ) return; if(!geojson && !state.fileToImport && state.fileToImport.size === 0 ) return;
...@@ -173,7 +173,7 @@ const feature_type = { ...@@ -173,7 +173,7 @@ const feature_type = {
let fileToImport; let fileToImport;
const { name, type } = geojson || state.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 if (state.fileToImport && state.fileToImport.size > 0) { //* if data in a binary file, read it as text
const textFile = await state.fileToImport.text(); const textFile = await state.fileToImport.text();
geojson = JSON.parse(textFile); 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