diff --git a/frontend/src/lib/api/dashboard/a76/customs-brokers.ts b/frontend/src/lib/api/dashboard/a76/customs-brokers.ts index a3faa96e..f91acdcb 100644 --- a/frontend/src/lib/api/dashboard/a76/customs-brokers.ts +++ b/frontend/src/lib/api/dashboard/a76/customs-brokers.ts @@ -1,26 +1,7 @@ import { api } from '$lib/api'; import type { ApiResponse } from '$lib/api'; -export interface CustomsBroker { - type?: string | null; - broker_key: string; - name?: string | null; - address?: string | null; - postal_code?: string | null; - city?: string | null; - state?: string | null; - phone?: string | null; - fax?: string | null; - email?: string | null; - country?: string | null; - tax_id?: string | null; - personal_id?: string | null; - position?: string | null; - license: string; - company?: string | null; - contact?: string | null; - tenant_id: string; - company_id: string; +export interface CustomsBroker { id: number; type?: string | null; broker_key: string; @@ -117,13 +98,14 @@ export const customsBrokersApi = { return api.post(`/v1/a76/customs-brokers/?company_id=${companyId}`, data); }, - update: (brokerKey: string, data: CreateCustomsBrokerData, companyId: string) => { - return api.patch(`/v1/a76/customs-brokers/${brokerKey}?company_id=${companyId}`, data); - }, + /** + * Actualiza la información de un agente aduanal + */ + update: (brokerKey: string, data: CreateCustomsBrokerData) => { + const companyId = data.company_id; + return api.put(`/v1/a76/customs-brokers/${brokerKey}/?company_id=${companyId}`, data); + }, - delete: (brokerKey: string, companyId: string) => { - return api.delete(`/v1/a76/customs-brokers/${brokerKey}?company_id=${companyId}`); - }, /** * Elimina un agente aduanal */ @@ -131,13 +113,7 @@ export const customsBrokersApi = { return api.delete(`/v1/a76/customs-brokers/${brokerKey}/?company_id=${companyId}`); }, - /** - * Actualiza la información de un agente aduanal - */ - update: (brokerKey: string, data: CreateCustomsBrokerData) => { - const companyId = data.company_id; - return api.put(`/v1/a76/customs-brokers/${brokerKey}/?company_id=${companyId}`, data); - }, + updateVU: (brokerKey: string, data: CustomsBrokerVU, companyId: string) => { return api.put(`/v1/a76/customs-broker-vu/${brokerKey}?company_id=${companyId}`, data);