Actualizada ruta para saldos

This commit is contained in:
Alejandro Tasistro 2025-06-19 18:07:56 -03:00
parent 37cdbe5480
commit 0e63e795e4

View file

@ -17,7 +17,7 @@ const mutations = {
const actions = {
async getGruposDeCompra({ commit }) {
const response = await axios.get('/api/grupos-de-compra');
const response = await axios.get('/api/grupos-de-compra/saldos');
commit('setGruposDeCompra', response.data);
},
async setSaldo({ commit, dispatch }, { gdc_id, saldo }) {
@ -29,6 +29,7 @@ const actions = {
commit('setSaldo', { gdc_id: gdc_id, saldo: saldo });
dispatch("ui/toast", { mensaje: 'Saldo modificado con éxito' }, { root: true });
} catch (error) {
dispatch("ui/error", { error: error }, { root: true });
}
},
async cargarSaldos({ commit, dispatch }, formData) {
@ -48,7 +49,7 @@ const actions = {
};
const getters = {
getSaldo() {
saldo() {
return (gdc_id) => state.grupos_de_compra.find(gdc => gdc.id === gdc_id)?.saldo ?? 0;
},
};