feat : admin fournisseurs creation et modif (WIP)

This commit is contained in:
2026-02-11 08:18:55 +01:00
parent 83b339746e
commit 1e794bba00
7 changed files with 389 additions and 60 deletions

View File

@@ -20,6 +20,7 @@ export async function createAddress(
return await api.post<AddressData>('addresses', payload, {
toastErrorKey: 'errors.address.create',
toastSuccessKey: 'success.address.create',
})
}
@@ -31,5 +32,14 @@ export async function updateAddress(
return await api.patch<AddressData>(`addresses/${id}`, payload, {
toastErrorKey: 'errors.address.update',
toastSuccessKey: 'success.address.update',
})
}
export async function getAddress(id: number): Promise<AddressData> {
const api = useApi()
return await api.get<AddressData>(`addresses/${id}`, {}, {
toastErrorKey: 'errors.address.fetch',
})
}

View File

@@ -21,5 +21,5 @@ export type SupplierPayload = {
name: string
email?: string | null
phone?: string | null
addresses: string[]
addresses?: string[]
}