feat : finalisation de l'étape 1 "Réception" (formulaire)

This commit is contained in:
2026-01-27 16:59:36 +01:00
parent 9ae073e69e
commit f901d52324
46 changed files with 1977 additions and 88 deletions

View File

@@ -0,0 +1,23 @@
import { useApi } from '~/composables/useApi'
import type { ReceptionTypeData } from '~/services/dto/reception-type-data'
export type ReceptionTypeListResponse =
| ReceptionTypeData[]
| { 'hydra:member'?: ReceptionTypeData[] }
export async function getReceptionTypeList(): Promise<ReceptionTypeData[]> {
const api = useApi()
const response = await api.get<ReceptionTypeListResponse>('reception_types', {}, {
toastErrorKey: 'errors.receptionType.list'
})
if (Array.isArray(response)) {
return response
}
if (response && typeof response === 'object' && Array.isArray(response['hydra:member'])) {
return response['hydra:member']
}
return []
}