800ab1d432
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | #320 | Modification réception terminé étape 2 | ## Description de la PR ## Modification du .env ## Check list - [x] Pas de régression - [ ] TU/TI/TF rédigée - [x] TU/TI/TF OK - [x] CHANGELOG modifié Reviewed-on: https://gitea.malio.fr/MALIO-DEV/Ferme/pulls/21 Reviewed-by: Autin <tristan@yuno.malio.fr> Co-authored-by: sroy <sebastien@yuno.malio.fr> Co-committed-by: sroy <sebastien@yuno.malio.fr>
24 lines
691 B
TypeScript
24 lines
691 B
TypeScript
import { useApi } from '~/composables/useApi'
|
|
import type { WeightEntryData } from '~/services/dto/reception-data'
|
|
|
|
export type WeightPayload = {
|
|
reception: string
|
|
type: 'gross' | 'tare'
|
|
dsd: number | null
|
|
weight: number | null
|
|
weighedAt: string | null
|
|
}
|
|
|
|
export async function createWeight(payload: WeightPayload) {
|
|
const api = useApi()
|
|
return api.post<WeightEntryData>('weights', payload)
|
|
}
|
|
|
|
export async function updateWeight(id: number, payload: Partial<WeightPayload>) {
|
|
const api = useApi()
|
|
return api.patch<WeightEntryData>(`weights/${id}`, payload,{
|
|
toastErrorKey: 'errors.weight.update',
|
|
toastSuccessKey: 'success.weight.update'
|
|
})
|
|
}
|