Moviendo logica

This commit is contained in:
Alejandro Tasistro 2025-08-13 01:49:07 -03:00
parent 544f54e95d
commit fdfba78d21
2 changed files with 4 additions and 5 deletions

View file

@ -74,9 +74,10 @@ export default {
...mapActions('ui', ["toast", "error"]), ...mapActions('ui', ["toast", "error"]),
async confirmar() { async confirmar() {
if (this.grupo_de_compra_nuevo) if (this.grupo_de_compra_nuevo)
this.crear(); await this.crear();
else else
this.modificar(); await this.modificar();
this.cerrar();
}, },
async crear() { async crear() {
await this.crearBarrio({ await this.crearBarrio({
@ -98,7 +99,6 @@ export default {
passAdmin: this.passAdmin, passAdmin: this.passAdmin,
passOllas: this.passOllas, passOllas: this.passOllas,
}) })
this.cerrar();
}, },
cerrar() { cerrar() {
this.toggleModalBarrio(); this.toggleModalBarrio();

View file

@ -29,8 +29,6 @@ const mutations = {
}, },
seleccionarGrupoDeCompra(state, { grupo_de_compra }) { seleccionarGrupoDeCompra(state, { grupo_de_compra }) {
state.grupo_de_compra_actual = grupo_de_compra; state.grupo_de_compra_actual = grupo_de_compra;
if (!grupo_de_compra)
state.grupo_de_compra_nuevo = false;
}, },
actualizarGrupoDeCompra(state, { gdc_id, nombre, region }) { actualizarGrupoDeCompra(state, { gdc_id, nombre, region }) {
const barrio = state.grupos_de_compra.find(gdc => gdc.id === gdc_id); const barrio = state.grupos_de_compra.find(gdc => gdc.id === gdc_id);
@ -46,6 +44,7 @@ const mutations = {
}, },
agregarGrupoDeCompra(state, grupo_de_compra) { agregarGrupoDeCompra(state, grupo_de_compra) {
state.grupos_de_compra.push(grupo_de_compra); state.grupos_de_compra.push(grupo_de_compra);
state.grupo_de_compra_nuevo = false;
}, },
}; };