Agregados getters para datos de productos
This commit is contained in:
parent
08a731673b
commit
5468b79562
1 changed files with 9 additions and 0 deletions
9
resources/js/store/modules/pedido.js
vendored
9
resources/js/store/modules/pedido.js
vendored
|
@ -48,6 +48,15 @@ const getters = {
|
|||
pedidoDefinido() {
|
||||
return state.lastFetch !== null;
|
||||
},
|
||||
enChismosa() {
|
||||
return ((producto_id) => state.productos.some(p => p.id === producto_id));
|
||||
},
|
||||
cantidad() {
|
||||
return ((producto_id) => state.productos.find(p => p.id === producto_id).pivot.cantidad);
|
||||
},
|
||||
notas() {
|
||||
return ((producto_id) => state.productos.find(p => p.id === producto_id).pivot.notas);
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
|
|
Loading…
Add table
Reference in a new issue