quitado parametro tipo_id
This commit is contained in:
parent
eddf2776d0
commit
db714a209c
1 changed files with 4 additions and 9 deletions
13
resources/js/store/modules/pedido.js
vendored
13
resources/js/store/modules/pedido.js
vendored
|
@ -52,24 +52,19 @@ const actions = {
|
|||
const response = await axios.get('/user/grupo_de_compra');
|
||||
commit('setGrupoDeCompra', response.data.grupo_de_compra);
|
||||
},
|
||||
async guardarSesion(_, { pedido_id, tipo_sesion }) {
|
||||
async guardarSesion(_, { pedido_id }) {
|
||||
const body = { id: pedido_id };
|
||||
await axios.post(`/${tipo_sesion}/sesion`, body);
|
||||
await axios.post("/pedido/sesion", body);
|
||||
},
|
||||
async crearPedido({ commit, dispatch }, { nombre, grupo_de_compra_id, tipo_id }) {
|
||||
const body = { nombre, grupo_de_compra_id, tipo_id };
|
||||
const response = await axios.post("/api/subpedidos", body);
|
||||
|
||||
let tipo_sesion = 'pedido';
|
||||
if (tipo_id !== 1)
|
||||
tipo_sesion = 'ollas';
|
||||
|
||||
dispatch("guardarSesion", { pedido_id: response.data.data.id, tipo_sesion: tipo_sesion });
|
||||
dispatch("guardarSesion", { pedido_id: response.data.data.id});
|
||||
commit('setPedido', response.data.data);
|
||||
},
|
||||
async elegirPedido({ commit, dispatch }, { pedido_id }) {
|
||||
const response = await axios.get(`/api/subpedidos/${pedido_id}`);
|
||||
const body = { pedido_id: pedido_id, tipo_sesion: 'pedido' };
|
||||
const body = { pedido_id: pedido_id};
|
||||
dispatch("guardarSesion", body)
|
||||
commit('setPedido', response.data.data);
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue