From 9b26b43aca395562a730e2d24b15d6717ba65808 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Fri, 19 Jun 2026 21:18:22 +0200 Subject: [PATCH] fix(core) : align audit entity-types front service with single-resource api shape --- frontend/modules/core/services/audit-logs.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/modules/core/services/audit-logs.ts b/frontend/modules/core/services/audit-logs.ts index 832bc7b..3af46d7 100644 --- a/frontend/modules/core/services/audit-logs.ts +++ b/frontend/modules/core/services/audit-logs.ts @@ -27,9 +27,9 @@ export type AuditLogPage = { totalItems: number } -export type AuditLogEntityType = { +export type AuditLogEntityTypes = { '@id'?: string - value: string + entityTypes: string[] } export function useAuditLogService() { @@ -55,8 +55,10 @@ export function useAuditLogService() { } async function entityTypes(): Promise { - const data = await api.get>('/audit-log-entity-types') - return extractHydraMembers(data).map((entry) => entry.value) + // `/audit-log-entity-types` is a single API Platform item resource + // (not a hydra collection): it returns `{ entityTypes: string[] }`. + const data = await api.get('/audit-log-entity-types') + return data.entityTypes ?? [] } return { list, entityTypes }