feat : add Client DTO, service and Hydra utils (frontend)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
8
frontend/utils/api.ts
Normal file
8
frontend/utils/api.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export type HydraCollection<T> = {
|
||||
'hydra:member': T[]
|
||||
'hydra:totalItems': number
|
||||
}
|
||||
|
||||
export function extractHydraMembers<T>(response: HydraCollection<T>): T[] {
|
||||
return response['hydra:member'] ?? []
|
||||
}
|
||||
Reference in New Issue
Block a user