From 577de97a8f92d6dc4abe98e001db317241817410 Mon Sep 17 00:00:00 2001
From: Bastien DUMONT <bdumont@grandlyon.com>
Date: Wed, 12 Apr 2023 06:57:19 +0000
Subject: [PATCH] fix(profile): fix typo and infinite loading in analysis

---
 src/locales/fr.json              |  2 +-
 src/migrations/migration.data.ts | 17 ++++++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/locales/fr.json b/src/locales/fr.json
index adec1a65d..d646b5300 100644
--- a/src/locales/fr.json
+++ b/src/locales/fr.json
@@ -984,7 +984,7 @@
       "title": "Logement",
       "question": "De quel type de logement disposez-vous\u00a0?",
       "individual_house": "Maison individuelle",
-      "appartment": "Appartement"
+      "apartment": "Appartement"
     },
     "construction_year": {
       "title": "Construction",
diff --git a/src/migrations/migration.data.ts b/src/migrations/migration.data.ts
index 758dfc12f..1eb80f0c7 100644
--- a/src/migrations/migration.data.ts
+++ b/src/migrations/migration.data.ts
@@ -565,7 +565,22 @@ export const migrations: Migration[] = [
         if (doc.partnersIssueDate) {
           delete doc.partnersIssueDate
         }
-        // TODO remove this ?
+        return doc
+      })
+    },
+  },
+  {
+    baseSchemaVersion: 22,
+    targetSchemaVersion: 23,
+    appVersion: '2.3.0',
+    description: 'Fix apartment typo',
+    releaseNotes: null,
+    docTypes: PROFILETYPE_DOCTYPE,
+    run: async (_client: Client, docs: any[]) => {
+      return docs.map(doc => {
+        if (doc.housingType === 'appartment') {
+          doc.housingType = 'apartment'
+        }
         return doc
       })
     },
-- 
GitLab