From 26f36e40aedc50c6e497b0623231ab5e55a73e8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Poussard?= <tpoussard@neogeo.fr>
Date: Thu, 27 Jan 2022 17:02:04 +0100
Subject: [PATCH] fix import from geojson

---
 src/views/feature_type/Feature_type_detail.vue | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/views/feature_type/Feature_type_detail.vue b/src/views/feature_type/Feature_type_detail.vue
index fd9ff464..1beab1d4 100644
--- a/src/views/feature_type/Feature_type_detail.vue
+++ b/src/views/feature_type/Feature_type_detail.vue
@@ -539,9 +539,9 @@ export default {
         slug: this.slug,
         feature_type_slug: this.$route.params.feature_type_slug,
       };
-      if (this.$route.params.geojson) {
+      if (this.$route.params.geojson) { //* import after redirection, for instance with data from catalog
         payload['geojson'] = this.$route.params.geojson;
-      } else if (this.fileToImport && !this.fileToImport.name) {
+      } else if (this.fileToImport.size > 0) { //* import directly from geojson
         payload['fileToImport'] = this.fileToImport;
       } else {
         this.importError = "La ressource n'a pas pu être récupéré.";
-- 
GitLab