diff --git a/src/pages/sincronizar_clientes_tryton.vue b/src/pages/sincronizar_clientes_tryton.vue index 625c874..6fee0e3 100644 --- a/src/pages/sincronizar_clientes_tryton.vue +++ b/src/pages/sincronizar_clientes_tryton.vue @@ -1,42 +1,126 @@ @@ -53,11 +137,8 @@ data() { return { api: inject('api'), - checked_tryton_parties: [], - created_customers: [], - failed_parties: [], - untouched_customers: [], - updated_customers: [], + loading: false, + result: null, } }, mounted() { @@ -66,16 +147,20 @@ } }, methods: { + formatItems(ids) { + if (!ids || ids.length === 0) return []; + return ids.map(id => ({ id })); + }, startSync() { + this.loading = true; this.api.getCustomersFromTryton() .then(response => { - this.checked_tryton_parties = response.checked_tryton_parties.map(id => ({ id })); - this.created_customers = response.created_customers.map(id => ({ id })); - this.failed_parties = response.failed_parties.map(id => ({ id })); - this.untouched_customers = response.untouched_customers.map(id => ({ id })); + this.result = response; + this.loading = false; }) .catch(error => { - console.error("Error al sincronizar clientes:", error); + console.error('Error al sincronizar clientes:', error); + this.loading = false; }); } }