DODA mejorado

This commit is contained in:
2026-02-11 13:45:20 -06:00
parent 573dd00056
commit 6e276cd8a9
11 changed files with 1243 additions and 398 deletions

View File

@@ -5,25 +5,25 @@
import { api } from '$lib/api';
export interface CustomsSection {
customs_code: string;
section_name: string;
customs_code: string;
section_name: string;
}
export interface CustomsSectionListResponse {
items: CustomsSection[];
total: number;
page: number;
page_size: number;
items: CustomsSection[];
total: number;
page: number;
page_size: number;
}
export interface CreateCustomsSectionData {
customs_code: string;
section_name: string;
customs_code: string;
section_name: string;
}
export interface UpdateCustomsSectionData {
customs_code?: string;
section_name?: string;
customs_code?: string;
section_name?: string;
}
/**
@@ -37,7 +37,6 @@ export const customsSectionsApi = {
*/
list: (page = 1, pageSize = 50) =>
api.get<CustomsSectionListResponse>(
// CORREGIDO: Añadido '/' antes de los parámetros
`/v1/public/reference_data/customs-sections/?page=${page}&page_size=${pageSize}`
),
@@ -45,7 +44,7 @@ export const customsSectionsApi = {
* Obtiene una sección aduanera por código
* @param customs_code - Código de la sección aduanera
*/
get: (customs_code: string) =>
get: (customs_code: string) =>
// CORREGIDO: Añadido '/' final
api.get<CustomsSection>(`/v1/public/reference_data/customs-sections/${customs_code}/`),
@@ -70,7 +69,7 @@ export const customsSectionsApi = {
* Elimina una sección aduanera
* @param customs_code - Código de la sección aduanera a eliminar
*/
delete: (customs_code: string) =>
delete: (customs_code: string) =>
// CORREGIDO: Añadido '/' después del código
api.delete(`/v1/public/reference_data/customs-sections/${customs_code}/`)
};