Browse Source

remove lodash calls (ongoing)

Olivier Massot 9 months ago
parent
commit
a5465e10b4

+ 1 - 0
.eslintrc.cjs

@@ -18,6 +18,7 @@ module.exports = {
     'plugin:@typescript-eslint/recommended',
     'plugin:vue/vue3-recommended',
     'plugin:prettier/recommended',
+    'plugin:you-dont-need-lodash-underscore/compatible',
   ],
   ignorePatterns: [
     '.nuxt',

+ 1 - 2
components/Ui/Form.vue

@@ -93,7 +93,6 @@ de quitter si des données ont été modifiées.
 import { computed, ref, watch } from 'vue'
 import type { ComputedRef, Ref, PropType } from 'vue'
 import type { RouteLocationNormalized, RouteLocationRaw } from 'vue-router'
-import * as _ from 'lodash-es'
 import { FORM_FUNCTION, SUBMIT_TYPE, TYPE_ALERT } from '~/types/enum/enums'
 import { useFormStore } from '~/stores/form'
 import { useEntityManager } from '~/composables/data/useEntityManager'
@@ -353,7 +352,7 @@ const cancel = () => {
 }
 
 const actions = computed(() => {
-  return _.keys(props.submitActions)
+  return Object.keys(props.submitActions)
 })
 
 // #### Validation et store

+ 0 - 1
components/Ui/Input/Autocomplete/Accesses.vue

@@ -34,7 +34,6 @@ import type { AnyJson, AssociativeArray } from '~/types/data'
 import { useEntityFetch } from '~/composables/data/useEntityFetch'
 import Access from '~/models/Access/Access'
 import { useEntityManager } from '~/composables/data/useEntityManager'
-import ArrayUtils from '~/services/utils/arrayUtils'
 import * as _ from 'lodash-es'
 
 const props = defineProps({

+ 4 - 5
composables/form/useFieldViolation.ts

@@ -1,6 +1,5 @@
 import { computed } from 'vue'
 import type { ComputedRef } from 'vue'
-import * as _ from 'lodash-es'
 import { useFormStore } from '~/stores/form'
 
 /**
@@ -10,7 +9,7 @@ import { useFormStore } from '~/stores/form'
  */
 export function useFieldViolation(field: string) {
   const fieldViolations: ComputedRef<string> = computed(() => {
-    return _.get(useFormStore().violations, field, '')
+    return useFormStore().violations?.[field] ?? ''
   })
 
   /**
@@ -18,9 +17,9 @@ export function useFieldViolation(field: string) {
    * @param field
    */
   function updateViolationState(field: string) {
-    useFormStore().setViolations(
-      _.omit(useFormStore().violations, field) as string[],
-    )
+    const { [field]: _, ...fieldViolations } = useFormStore().violations
+
+    useFormStore().setViolations(fieldViolations as string[])
   }
 
   return {

+ 6 - 8
composables/layout/useExtensionPanel.ts

@@ -1,5 +1,4 @@
 import type { Ref } from 'vue'
-import * as _ from 'lodash-es'
 
 /**
  * @category composables/form
@@ -11,14 +10,13 @@ export function useExtensionPanel(route: Ref) {
 
   onMounted(() => {
     setTimeout(function () {
-      _.each(
+      Object.entries(
         document.getElementsByClassName('v-expansion-panel'),
-        (element, index) => {
-          if (element.id === activeAccordionId) {
-            panel.value = index
-          }
-        },
-      )
+      ).forEach((element, index) => {
+        if (element.id === activeAccordionId) {
+          panel.value = index
+        }
+      })
       if (!panel.value) {
         panel.value = 0
       }

+ 213 - 197
nuxt.config.ts

@@ -30,200 +30,216 @@ if (process.env.NUXT_ENV === 'dev') {
  * @see https://nuxt.com/docs/api/configuration/nuxt-config
  */
 export default defineNuxtConfig({
-  ssr: true,
-  experimental: {
-    // Fix the 'Cannot stringify non POJO' bug
-    // @see https://github.com/nuxt/nuxt/issues/20787
-    renderJsonPayloads: false,
-  },
-  runtimeConfig: {
-    // Private config that is only available on the server
-    env: '',
-    baseUrl: '',
-    baseUrlLegacy: '',
-    baseUrlAdminLegacy: '',
-    baseUrlTypo3: '',
-    baseUrlMercure: '',
-    fileStorageBaseUrl: '',
-    supportUrl: '',
-    basicomptaUrl: 'https://app.basicompta.fr/',
-    // Config within public will be also exposed to the client
-    public: {
-      env: '',
-      baseUrl: '',
-      baseUrlLegacy: '',
-      baseUrlAdminLegacy: '',
-      baseUrlTypo3: '',
-      baseUrlMercure: '',
-      fileStorageBaseUrl: '',
-      supportUrl: '',
-      basicomptaUrl: 'https://app.basicompta.fr/',
-    },
-  },
-  hooks: {
-    'builder:watch': console.log,
-  },
-  app: {
-    head: {
-      title: 'Opentalent',
-      meta: [
-        { charset: 'utf-8' },
-        { name: 'viewport', content: 'width=device-width, initial-scale=1' },
-        { name: 'msapplication-TileColor', content: '#324250' },
-        {
-          name: 'msapplication-TileImage',
-          content: '/favicon/favicon-144x144.png',
-        },
-      ],
-      link: [
-        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
-        {
-          rel: 'apple-touch-icon-precomposed',
-          sizes: '57x57',
-          href: '/favicon/apple-touch-icon-57x57.png',
-        },
-        {
-          rel: 'apple-touch-icon-precomposed',
-          sizes: '114x114',
-          href: '/favicon/apple-touch-icon-114x114.png',
-        },
-        {
-          rel: 'apple-touch-icon-precomposed',
-          sizes: '72x72',
-          href: '/favicon/apple-touch-icon-72x72.png',
-        },
-        {
-          rel: 'apple-touch-icon-precomposed',
-          sizes: '144x144',
-          href: '/favicon/apple-touch-icon-144x144.png',
-        },
-        {
-          rel: 'apple-touch-icon-precomposed',
-          sizes: '120x120',
-          href: '/favicon/apple-touch-icon-120x120.png',
-        },
-        {
-          rel: 'apple-touch-icon-precomposed',
-          sizes: '152x152',
-          href: '/favicon/apple-touch-icon-152x152.png',
-        },
-        {
-          rel: 'icon',
-          sizes: '32x32',
-          type: 'image/x-icon',
-          href: '/favicon/favicon-32x32.png',
-        },
-        {
-          rel: 'icon',
-          sizes: '16x16',
-          type: 'image/x-icon',
-          href: '/favicon/favicon-16x16.png',
-        },
-      ],
-    },
-  },
-  css: [
-    '@/assets/css/global.scss',
-    '@/assets/css/theme.scss',
-    '@/assets/css/import.scss',
-    '@vuepic/vue-datepicker/dist/main.css',
-  ],
-  typescript: {
-    strict: true,
-  },
-  modules: [
-    // eslint-disable-next-line require-await
-    async (_, nuxt) => {
-      nuxt.hooks.hook('vite:extendConfig', (config) =>
-        // @ts-expect-error A revoir après que les lignes aient été décommentées
-        (config.plugins ?? []).push(
-          vuetify(),
-          // Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
-          // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
-          // voir aussi : https://github.com/jrutila/nuxt3-vuetify3-bug
-          // vuetify({
-          //     styles: { configFile: './assets/css/settings.scss' }
-          // })
-        ),
-      )
-    },
-    [
-      '@pinia/nuxt',
-      {
-        autoImports: [
-          // automatically imports `usePinia()`
-          'defineStore',
-          // automatically imports `usePinia()` as `usePiniaStore()`
-          ['defineStore', 'definePiniaStore'],
-        ],
-      },
-    ],
-    '@pinia-orm/nuxt',
-    '@nuxtjs/i18n',
-    '@nuxt/devtools',
-    '@nuxt/image',
-    'nuxt-prepare',
-    'nuxt-vitalizer',
-  ],
-  vite: {
-    esbuild: {
-      drop: process.env.DEBUG ? [] : ['console', 'debugger'],
-      tsconfigRaw: {
-        compilerOptions: {
-          experimentalDecorators: true,
-        },
-      },
-    },
-    ssr: {
-      // with ssr enabled, this config is required to load vuetify properly
-      noExternal: ['vuetify'],
-    },
-    server: {
-      https,
-      // @ts-expect-error J'ignore pourquoi cette erreur TS se produit, cette propriété est valide
-      port: 443,
-      hmr: {
-        protocol: 'wss',
-        port: 24678,
-      },
-    },
-  },
-  // Hide the sourcemaps warnings with vuetify
-  // @see https://github.com/vuetifyjs/vuetify-loader/issues/290#issuecomment-1435702713
-  sourcemap: {
-    server: false,
-    client: false,
-  },
-  i18n: {
-    langDir: 'lang',
-    lazy: true,
-    strategy: 'no_prefix',
-    locales: [
-      {
-        code: 'en',
-        iso: 'en-US',
-        file: 'en.json',
-        name: 'English',
-      },
-      {
-        code: 'fr',
-        iso: 'fr-FR',
-        file: 'fr.json',
-        name: 'Français',
-      },
-    ],
-    defaultLocale: 'fr',
-    detectBrowserLanguage: false,
-    vueI18n: './i18n.config.ts',
-  },
-  image: {
-    provider: 'none',
-  },
-  build: {
-    transpile,
-  },
-  ignore: [process.env.NUXT_ENV === 'prod' ? 'pages/dev/*' : ''],
-  prepare: {
-    scripts: ['prepare/buildIndex.ts'],
-  },
-})
+ ssr: true,
+
+ experimental: {
+   // Fix the 'Cannot stringify non POJO' bug
+   // @see https://github.com/nuxt/nuxt/issues/20787
+   renderJsonPayloads: false,
+ },
+
+ runtimeConfig: {
+   // Private config that is only available on the server
+   env: '',
+   baseUrl: '',
+   baseUrlLegacy: '',
+   baseUrlAdminLegacy: '',
+   baseUrlTypo3: '',
+   baseUrlMercure: '',
+   fileStorageBaseUrl: '',
+   supportUrl: '',
+   basicomptaUrl: 'https://app.basicompta.fr/',
+   // Config within public will be also exposed to the client
+   public: {
+     env: '',
+     baseUrl: '',
+     baseUrlLegacy: '',
+     baseUrlAdminLegacy: '',
+     baseUrlTypo3: '',
+     baseUrlMercure: '',
+     fileStorageBaseUrl: '',
+     supportUrl: '',
+     basicomptaUrl: 'https://app.basicompta.fr/',
+   },
+ },
+
+ hooks: {
+   'builder:watch': console.log,
+ },
+
+ app: {
+   head: {
+     title: 'Opentalent',
+     meta: [
+       { charset: 'utf-8' },
+       { name: 'viewport', content: 'width=device-width, initial-scale=1' },
+       { name: 'msapplication-TileColor', content: '#324250' },
+       {
+         name: 'msapplication-TileImage',
+         content: '/favicon/favicon-144x144.png',
+       },
+     ],
+     link: [
+       { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
+       {
+         rel: 'apple-touch-icon-precomposed',
+         sizes: '57x57',
+         href: '/favicon/apple-touch-icon-57x57.png',
+       },
+       {
+         rel: 'apple-touch-icon-precomposed',
+         sizes: '114x114',
+         href: '/favicon/apple-touch-icon-114x114.png',
+       },
+       {
+         rel: 'apple-touch-icon-precomposed',
+         sizes: '72x72',
+         href: '/favicon/apple-touch-icon-72x72.png',
+       },
+       {
+         rel: 'apple-touch-icon-precomposed',
+         sizes: '144x144',
+         href: '/favicon/apple-touch-icon-144x144.png',
+       },
+       {
+         rel: 'apple-touch-icon-precomposed',
+         sizes: '120x120',
+         href: '/favicon/apple-touch-icon-120x120.png',
+       },
+       {
+         rel: 'apple-touch-icon-precomposed',
+         sizes: '152x152',
+         href: '/favicon/apple-touch-icon-152x152.png',
+       },
+       {
+         rel: 'icon',
+         sizes: '32x32',
+         type: 'image/x-icon',
+         href: '/favicon/favicon-32x32.png',
+       },
+       {
+         rel: 'icon',
+         sizes: '16x16',
+         type: 'image/x-icon',
+         href: '/favicon/favicon-16x16.png',
+       },
+     ],
+   },
+ },
+
+ css: [
+   '@/assets/css/global.scss',
+   '@/assets/css/theme.scss',
+   '@/assets/css/import.scss',
+   '@vuepic/vue-datepicker/dist/main.css',
+ ],
+
+ typescript: {
+   strict: true,
+ },
+
+ modules: [
+   // eslint-disable-next-line require-await
+   async (_, nuxt) => {
+     nuxt.hooks.hook('vite:extendConfig', (config) =>
+       // @ts-expect-error A revoir après que les lignes aient été décommentées
+       (config.plugins ?? []).push(
+         vuetify(),
+         // Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
+         // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
+         // voir aussi : https://github.com/jrutila/nuxt3-vuetify3-bug
+         // vuetify({
+         //     styles: { configFile: './assets/css/settings.scss' }
+         // })
+       ),
+     )
+   },
+   [
+     '@pinia/nuxt',
+     {
+       autoImports: [
+         // automatically imports `usePinia()`
+         'defineStore',
+         // automatically imports `usePinia()` as `usePiniaStore()`
+         ['defineStore', 'definePiniaStore'],
+       ],
+     },
+   ],
+   '@pinia-orm/nuxt',
+   '@nuxtjs/i18n',
+   '@nuxt/devtools',
+   '@nuxt/image',
+   'nuxt-prepare',
+   'nuxt-vitalizer',
+ ],
+
+ vite: {
+   esbuild: {
+     drop: process.env.DEBUG ? [] : ['console', 'debugger'],
+     tsconfigRaw: {
+       compilerOptions: {
+         experimentalDecorators: true,
+       },
+     },
+   },
+   ssr: {
+     // with ssr enabled, this config is required to load vuetify properly
+     noExternal: ['vuetify'],
+   },
+   server: {
+     https,
+     // @ts-expect-error J'ignore pourquoi cette erreur TS se produit, cette propriété est valide
+     port: 443,
+     hmr: {
+       protocol: 'wss',
+       port: 24678,
+     },
+   },
+ },
+
+ // Hide the sourcemaps warnings with vuetify
+ // @see https://github.com/vuetifyjs/vuetify-loader/issues/290#issuecomment-1435702713
+ sourcemap: {
+   server: false,
+   client: false,
+ },
+
+ i18n: {
+   langDir: 'lang',
+   lazy: true,
+   strategy: 'no_prefix',
+   locales: [
+     {
+       code: 'en',
+       iso: 'en-US',
+       file: 'en.json',
+       name: 'English',
+     },
+     {
+       code: 'fr',
+       iso: 'fr-FR',
+       file: 'fr.json',
+       name: 'Français',
+     },
+   ],
+   defaultLocale: 'fr',
+   detectBrowserLanguage: false,
+   vueI18n: './i18n.config.ts',
+ },
+
+ image: {
+   provider: 'none',
+ },
+
+ build: {
+   transpile,
+ },
+
+ ignore: [process.env.NUXT_ENV === 'prod' ? 'pages/dev/*' : ''],
+
+ prepare: {
+   scripts: ['prepare/buildIndex.ts'],
+ },
+
+ compatibilityDate: '2025-03-04'
+})

+ 11 - 2
plugins/init.server.ts

@@ -8,7 +8,7 @@ export default defineNuxtPlugin(async () => {
 
   const bearer: CookieRef<string | null> = useCookie('BEARER') ?? null
   const accessCookieId: CookieRef<string | null> = useCookie('AccessId') ?? null
-  const switchId: CookieRef<string | null> = useCookie('SwitchAccessId') ?? null
+  const switchCookieId: CookieRef<string | null> = useCookie('SwitchAccessId') ?? null
 
   if (accessCookieId.value === null || Number.isNaN(accessCookieId.value)) {
     redirectToLogout()
@@ -21,13 +21,22 @@ export default defineNuxtPlugin(async () => {
     return
   }
 
+  let switchId = null
+  if (switchCookieId.value !== null && typeof switchCookieId.value !== 'undefined') {
+    if (!isNaN(switchId)) {
+      switchId = parseInt(switchCookieId.value)
+    } else {
+      console.error('Invalid switch id : ' + switchCookieId.value)
+    }
+  }
+
   const { initiateProfile } = useRefreshProfile()
 
   try {
     await initiateProfile(
       accessId,
       bearer.value ?? '',
-      switchId.value !== null ? parseInt(switchId.value) : null,
+      switchId,
     )
   } catch (error) {
     if (error instanceof UnauthorizedError) {

+ 0 - 1
regex_pattern.txt

@@ -1 +0,0 @@
-(?!typo3/).*

+ 1 - 2
services/data/entityManager.ts

@@ -1,7 +1,6 @@
 import { Query as PiniaOrmQuery, Repository } from 'pinia-orm'
 import type { Collection as PiniaOrmCollection } from 'pinia-orm'
 import { v4 as uuid4 } from 'uuid'
-import * as _ from 'lodash-es'
 import { computed } from 'vue'
 import ApiRequestService from './apiRequestService'
 import UrlUtils from '~/services/utils/urlUtils'
@@ -411,7 +410,7 @@ class EntityManager {
     const repository = this.getRepository(model)
 
     // Clone and prefix id
-    const clone = _.cloneDeep(instance)
+    const clone = structuredClone(instance)
     clone.id = this.CLONE_PREFIX + clone.id
 
     repository.save(clone)

+ 2 - 2
services/data/normalizer/hydraNormalizer.ts

@@ -23,7 +23,7 @@ class HydraNormalizer {
       const value = entity[field]
       const targetEntity = iriEncodedFields[field].entity
 
-      if (_.isArray(value)) {
+      if (Array.isArray(value)) {
         entity[field] = value.map((id: number) => {
           return UrlUtils.makeIRI(targetEntity, id)
         })
@@ -185,7 +185,7 @@ class HydraNormalizer {
 
       const targetEntity = iriEncodedFields[field].entity
 
-      if (_.isArray(value)) {
+      if (Array.isArray(value)) {
         instance[field] = value.map((iri: string) => {
           return HydraNormalizer.getIdFromEntityIri(iri, targetEntity)
         })

+ 1 - 2
services/layout/menuBuilder/myAccessesMenuBuilder.ts

@@ -1,4 +1,3 @@
-import * as _ from 'lodash-es'
 import AbstractMenuBuilder from '~/services/layout/menuBuilder/abstractMenuBuilder'
 import type { MenuGroup, MenuItems } from '~/types/layout'
 import { MENU_LINK_TYPE } from '~/types/enum/layout'
@@ -15,7 +14,7 @@ export default class MyAccessesMenuBuilder extends AbstractMenuBuilder {
   build(): MenuGroup | null {
     const children: MenuItems = []
 
-    _.each(this.accessProfile.multiAccesses, (access) => {
+    Object.entries(this.accessProfile.multiAccesses).forEach((access) => {
       children.push(
         this.createItem(
           access.name as string,

+ 1 - 1
services/layout/menuBuilder/myFamilyMenuBuilder.ts

@@ -15,7 +15,7 @@ export default class MyFamilyMenuBuilder extends AbstractMenuBuilder {
   build(): MenuGroup | null {
     const children: MenuItems = []
     // Si Access des membres de la familles (enfants)
-    _.each(this.accessProfile.familyAccesses, (access) => {
+    Object.entries(this.accessProfile.familyAccesses).forEach((access) => {
       const url = `/switch_user/${this.organizationProfile.id}/${this.accessProfile.id}/${access.id}`
       const icon = {
         avatarId: access.avatarId,

+ 1 - 3
services/layout/menuBuilder/websiteListMenuBuilder.ts

@@ -1,4 +1,3 @@
-import * as _ from 'lodash-es'
 import AbstractMenuBuilder from '~/services/layout/menuBuilder/abstractMenuBuilder'
 import type { MenuGroup, MenuItems } from '~/types/layout'
 import { MENU_LINK_TYPE } from '~/types/enum/layout'
@@ -29,8 +28,7 @@ export default class WebsiteListMenuBuilder extends AbstractMenuBuilder {
     }
 
     // Add parents websites
-    _.each(
-      this.organizationProfile.parents,
+    Object.entries(this.organizationProfile.parents).forEach(
       (parent: BaseOrganizationProfile) => {
         if (
           parent.id &&

+ 1 - 3
services/rights/abilityBuilder.ts

@@ -1,7 +1,6 @@
 import type { MongoAbility } from '@casl/ability/dist/types/Ability'
 // eslint-disable-next-line import/default
 import yaml from 'yaml-import'
-import * as _ from 'lodash-es'
 import RoleUtils from '~/services/rights/roleUtils'
 import type { AbilitiesType, AccessProfile } from '~/types/interfaces'
 import { ABILITIES } from '~/types/enum/enums'
@@ -77,8 +76,7 @@ class AbilityBuilder {
     const doc = yaml.read(this.configFile)
     const fromConfig = doc.abilities
 
-    _.each(
-      fromConfig,
+    Object.entries(fromConfig).forEach(
       (
         ability: { action: ABILITIES; conditions: Array<Condition> },
         subject: string,

+ 1 - 2
services/rights/roleUtils.ts

@@ -1,4 +1,3 @@
-import * as _ from 'lodash-es'
 import type { AbilitiesType } from '~/types/interfaces'
 import type { AnyJson } from '~/types/data'
 
@@ -134,7 +133,7 @@ class RoleUtils {
   static rolesToAbilities(roles: Array<string>): [] | Array<AbilitiesType> {
     const abilities: Array<AbilitiesType> = []
 
-    _.each(roles, (role: string) => {
+    Object.entries(roles).forEach((role: string) => {
       const parsed: Role | null = RoleUtils.parseRole(role)
       const ability = RoleUtils.roleToAbility(parsed)
 

+ 2 - 2
services/utils/objectUtils.ts

@@ -3,9 +3,9 @@
  * @class ObjectUtils
  * Classe aidant à manipuler des Objets
  */
-import _ from 'lodash'
 import type { AnyJson } from '~/types/data'
 import StringUtils from '~/services/utils/stringUtils'
+
 export default class ObjectUtils {
   /**
    * Flatten un objet nested en un objet avec un seul niveau avec des noms de propriétés transformées comme cela 'foo.bar'
@@ -147,7 +147,7 @@ export default class ObjectUtils {
    * @param obj
    */
   static async hash(obj: object): Promise<string> {
-    const sortedObject = this.sortObjectsByKey(_.cloneDeep(obj))
+    const sortedObject = this.sortObjectsByKey(structuredClone(obj))
     return await StringUtils.hash(JSON.stringify(sortedObject), 'SHA-1')
   }
 }

+ 1 - 1
services/utils/urlUtils.ts

@@ -145,7 +145,7 @@ class UrlUtils {
    * @see https://api-platform.com/docs/admin/handling-relations/
    */
   public static makeIRI(entity: string, id: number) {
-    if (!_.isNumber(id)) {
+    if (!Number.isInteger(id)) {
       throw new TypeError('Invalid id : ' + id)
     }
     return `/api/${entity}/${id}`

+ 9 - 8
stores/accessProfile.ts

@@ -2,7 +2,6 @@ import { defineStore } from 'pinia'
 
 import { computed, ref } from 'vue'
 import type { Ref } from 'vue'
-import * as _ from 'lodash-es'
 import RoleUtils from '~/services/rights/roleUtils'
 import type {
   AbilitiesType,
@@ -67,16 +66,18 @@ export const useAccessProfileStore = defineStore('accessProfile', () => {
 
   // Actions
   const setMultiAccesses = (organizations: Array<BaseOrganizationProfile>) => {
-    _.each(organizations, (organization: BaseOrganizationProfile) => {
-      multiAccesses.value.push({
-        id: organization.id,
-        name: organization.name,
-      })
-    })
+    Object.entries(organizations).forEach(
+      (organization: BaseOrganizationProfile) => {
+        multiAccesses.value.push({
+          id: organization.id,
+          name: organization.name,
+        })
+      },
+    )
   }
 
   const setFamilyAccesses = (accesses: Array<BaseAccessProfile>) => {
-    _.each(accesses, (access: BaseAccessProfile) => {
+    Object.entries(accesses).forEach((access: BaseAccessProfile) => {
       const a: BaseAccessProfile = {
         id: access.id,
         name: access.name,

+ 1 - 2
stores/organizationProfile.ts

@@ -1,7 +1,6 @@
 import { defineStore } from 'pinia'
 import { computed } from 'vue'
 import type { Ref } from 'vue'
-import * as _ from 'lodash-es'
 import type { BaseOrganizationProfile } from '~/types/interfaces'
 import {
   LEGAL_STATUS,
@@ -181,7 +180,7 @@ export const useOrganizationProfileStore = defineStore(
       showAdherentList.value = profile.showAdherentList
       networks.value = Array.from(profile.networks)
 
-      _.each(profile.parents, (parent) => {
+      Object.entries(profile.parents).forEach((parent) => {
         parents.value.push({
           id: parent.id,
           name: parent.name,