fix(core) : align audit entity-types front service with single-resource api shape

This commit is contained in:
Matthieu
2026-06-19 21:18:22 +02:00
parent e7af415a1f
commit 9b26b43aca
+6 -4
View File
@@ -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<string[]> {
const data = await api.get<HydraCollection<AuditLogEntityType>>('/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<AuditLogEntityTypes>('/audit-log-entity-types')
return data.entityTypes ?? []
}
return { list, entityTypes }