diff --git a/src/pages/sincronizar_productos_tryton.vue b/src/pages/sincronizar_productos_tryton.vue index fcd74b0..d091ee5 100644 --- a/src/pages/sincronizar_productos_tryton.vue +++ b/src/pages/sincronizar_productos_tryton.vue @@ -1,37 +1,113 @@ @@ -48,7 +124,8 @@ data() { return { api: inject('api'), - productos_tryton: [{}], + loading: false, + result: null, } }, mounted() { @@ -57,8 +134,21 @@ } }, methods: { + formatItems(ids) { + if (!ids || ids.length === 0) return []; + return ids.map(id => ({ id })); + }, startSync() { - this.productos_tryton = this.api.getProductsFromTryton() + this.loading = true; + this.api.getProductsFromTryton() + .then(response => { + this.result = response; + this.loading = false; + }) + .catch(error => { + console.error('Error al sincronizar productos:', error); + this.loading = false; + }); } } }