feat : ajout de la génération du bon de reception, correction de la base du formulaire multi-etape de reception et ajout d'une gestion d'erreur global

This commit is contained in:
AUTIN Tristan
2026-01-15 18:37:44 +01:00
parent 4a77449a41
commit 94ea49587a
22 changed files with 1153 additions and 220 deletions
+4 -14
View File
@@ -1,8 +1,6 @@
import { useApi } from '~/composables/useApi'
import type { WeightEntryData } from '~/services/dto/reception-data'
const api = useApi()
export type WeightPayload = {
reception: string
type: 'gross' | 'tare'
@@ -12,19 +10,11 @@ export type WeightPayload = {
}
export async function createWeight(payload: WeightPayload) {
try {
return await api.post<WeightEntryData>('weights', payload)
} catch (error) {
console.error(error.message, error)
throw error
}
const api = useApi()
return api.post<WeightEntryData>('weights', payload)
}
export async function updateWeight(id: number, payload: Partial<WeightPayload>) {
try {
return await api.patch<WeightEntryData>(`weights/${id}`, payload)
} catch (error) {
console.error(error.message, error)
throw error
}
const api = useApi()
return api.patch<WeightEntryData>(`weights/${id}`, payload)
}