From 192f9736d46a8fa85a5485ec5e7a060518e729e9 Mon Sep 17 00:00:00 2001
From: Bastien DUMONT <bdumont@grandlyon.com>
Date: Thu, 3 Oct 2024 14:03:50 +0200
Subject: [PATCH] chore: remove some any type

---
 .../ProfileTypeFormDateSelection.tsx            | 17 ++++++++---------
 src/models/account.model.ts                     |  2 +-
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/components/ProfileType/ProfileTypeFormDateSelection/ProfileTypeFormDateSelection.tsx b/src/components/ProfileType/ProfileTypeFormDateSelection/ProfileTypeFormDateSelection.tsx
index 51a7ccf53..ea80ef06b 100644
--- a/src/components/ProfileType/ProfileTypeFormDateSelection/ProfileTypeFormDateSelection.tsx
+++ b/src/components/ProfileType/ProfileTypeFormDateSelection/ProfileTypeFormDateSelection.tsx
@@ -104,17 +104,16 @@ const ProfileTypeFormDateSelection = ({
     setNextStep({ ...profileType, [answerType.attribute]: answer })
   }
 
-  function handleSelectMonth(event: any) {
+  function handleSelectMonth(value: string) {
     setSelectedMonth({
-      value: event.target.value,
-      label: getMonthFullName(parseInt(event.target.value)),
+      value: value,
+      label: getMonthFullName(parseInt(value)),
     })
-    setAnswer(buildISODate(selectedYear.toString(), event.target.value))
+    setAnswer(buildISODate(selectedYear.toString(), value))
   }
 
-  function handleSelectYear(event: any) {
-    setSelectedYear(parseInt(event.target.value))
-    setAnswer(buildISODate(event.target.value, selectedMonth.value))
+  function handleSelectYear(value: string) {
+    setAnswer(buildISODate(value, selectedMonth.value))
   }
 
   /** If current year, only show past and present months else show full months */
@@ -139,7 +138,7 @@ const ProfileTypeFormDateSelection = ({
                 className="month"
                 defaultValue={selectedMonth.value}
                 value={selectedMonth.value}
-                onChange={e => handleSelectMonth(e)}
+                onChange={e => handleSelectMonth(e.target.value)}
               >
                 {renderMonths.map(month => (
                   <MenuItem
@@ -158,7 +157,7 @@ const ProfileTypeFormDateSelection = ({
                 className="year"
                 defaultValue={selectedYear}
                 value={selectedYear}
-                onChange={e => handleSelectYear(e)}
+                onChange={e => handleSelectYear(e.target.value)}
               >
                 {selectYears.map(year => (
                   <MenuItem value={year} key={year} className="date-option">
diff --git a/src/models/account.model.ts b/src/models/account.model.ts
index bb125bcc9..4595f62e3 100644
--- a/src/models/account.model.ts
+++ b/src/models/account.model.ts
@@ -12,7 +12,7 @@ export interface Account extends AccountAttributes {
   id?: string
   _rev?: string
   _type?: string
-  cozyMetadata?: Record<string, any>
+  cozyMetadata?: Record<string, unknown>
 }
 export interface SgeAccountData {
   consentId: number
-- 
GitLab