Se agrego la forma de seleccion de clase, cliente y unidades de medida
This commit is contained in:
@@ -183,7 +183,7 @@ export interface UnitOfMeasureGeneralUpdate {
|
||||
}
|
||||
|
||||
export interface UnitOfMeasureGeneralListResponse {
|
||||
items: UnitOfMeasureGeneral[];
|
||||
items: UnitOfMeasureGeneral[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
@@ -273,3 +273,38 @@ export async function updateUnitOfMeasureCustoms(id: number, data: UnitOfMeasure
|
||||
export async function deleteUnitOfMeasureCustoms(id: number, companyId: number): Promise<ApiResponse<void>> {
|
||||
return await api.delete(`/v1/a76/units-of-measure/customs/${id}/?company_id=${companyId}`);
|
||||
}
|
||||
|
||||
export interface UnitOfMeasure {
|
||||
id: number;
|
||||
code: string; // Ej: KG, PZ
|
||||
description: string | null;
|
||||
description_en: string | null;
|
||||
customs_code: string | null;
|
||||
american_code: string | null;
|
||||
created_at: string | null;
|
||||
updated_at: string | null;
|
||||
}
|
||||
|
||||
export interface UnitOfMeasureListResponse {
|
||||
items: UnitOfMeasure[];
|
||||
total: number;
|
||||
page: number;
|
||||
page_size: number;
|
||||
pages: number;
|
||||
}
|
||||
|
||||
export async function getUnitsOfMeasure(
|
||||
page: number = 1,
|
||||
pageSize: number = 50,
|
||||
companyId: number,
|
||||
filters: Record<string, any> = {}
|
||||
): Promise<ApiResponse<UnitOfMeasureListResponse>> {
|
||||
const queryParams = new URLSearchParams({
|
||||
page: page.toString(),
|
||||
page_size: pageSize.toString(),
|
||||
company_id: companyId.toString(),
|
||||
...filters
|
||||
});
|
||||
// Apunta a /v1/a76/units-of-measure/ (La ruta base del router)
|
||||
return await api.get(`/v1/a76/units-of-measure/?${queryParams.toString()}`);
|
||||
}
|
||||
Reference in New Issue
Block a user