diff --git a/resources/js/store/modules/admin/index.ts b/resources/js/store/modules/admin/index.ts index bec6b01..4da30e9 100644 --- a/resources/js/store/modules/admin/index.ts +++ b/resources/js/store/modules/admin/index.ts @@ -17,6 +17,7 @@ const state: AdminState = { total_transporte: undefined, cantidad_transporte: undefined, saldo: undefined, + productos_cantidades: [], }; const mutations = { @@ -40,6 +41,8 @@ const mutations = { state.total_transporte = grupo_de_compra.total_transporte; state.cantidad_transporte = grupo_de_compra.cantidad_transporte; state.saldo = grupo_de_compra.saldo; + state.productos_cantidades = grupo_de_compra.productos_cantidades + .map(pc => ({...pc, cantidad: parseInt(pc.cantidad)})); }, toggleCaracteristica(state, { caracteristica_id }) { state[`${caracteristica_id}_habilitadas`] = !state[`${caracteristica_id}_habilitadas`]; diff --git a/resources/js/store/modules/admin/types.ts b/resources/js/store/modules/admin/types.ts index 6e38ad7..3991dbb 100644 --- a/resources/js/store/modules/admin/types.ts +++ b/resources/js/store/modules/admin/types.ts @@ -17,6 +17,7 @@ export interface Barrio { total_transporte?: number, cantidad_transporte?: number, saldo?: number, + productos_cantidades: ProductoCantidad[], } export interface Pedido { @@ -31,3 +32,8 @@ export interface Pedido { devoluciones_total: number, devoluciones_notas: string } + +export interface ProductoCantidad { + id: number, + cantidad: number, +}