Skip to content
Snippets Groups Projects
Merged Timothee P requested to merge redmine-issues/12378 into develop
Files
2
@@ -167,13 +167,12 @@ const feature_type = {
let { feature_type_slug, geojson } = payload;
//* check if geojson then build a file
if(!geojson && !state.fileToImport && state.fileToImport.size === 0 ) return
let formData = new FormData();
let fileToImport;
const {name, type} = geojson || state.fileToImport;
if (!rootGetters.project.moderation) {
if (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();
geojson = JSON.parse(textFile);
}
@@ -183,7 +182,7 @@ const feature_type = {
};
}
fileToImport = new File([JSON.stringify(geojson)], name, {type});
formData.append('json_file', geojson ? fileToImport : state.fileToImport);
formData.append('feature_type_slug', feature_type_slug);
let url =
@@ -206,7 +205,6 @@ const feature_type = {
.catch((error) => {
throw (error);
});
// }
},
GET_IMPORTS({ commit }, { project_slug, feature_type }) {
Loading