|
|
@@ -2,7 +2,8 @@ import type { VueI18n } from 'vue-i18n'
|
|
|
import type ApiRequestService from './apiRequestService'
|
|
|
import UrlUtils from '~/services/utils/urlUtils'
|
|
|
import HydraNormalizer from '~/services/data/normalizer/hydraNormalizer'
|
|
|
-import type { Collection, Enum } from '~/types/data.d'
|
|
|
+import type { AnyJson, Collection, Enum } from '~/types/data.d'
|
|
|
+import type { EnumChoice } from '~/types/interfaces'
|
|
|
|
|
|
class EnumManager {
|
|
|
private apiRequestService: ApiRequestService
|
|
|
@@ -18,10 +19,8 @@ class EnumManager {
|
|
|
|
|
|
const response = await this.apiRequestService.get(url)
|
|
|
|
|
|
- // @ts-expect-error Response here is a Json Hydra response
|
|
|
- const { data } = HydraNormalizer.denormalize(response) as {
|
|
|
- data: Collection
|
|
|
- }
|
|
|
+ // @ts-expect-error J'ignore pourquoi, mais response ici est bien de type AnyJson, et non Response...
|
|
|
+ const { data } = HydraNormalizer.denormalize(response) as { data: Collection<Record<string>> }
|
|
|
|
|
|
const enum_: Enum = []
|
|
|
for (const key in data.items) {
|