From d1527b3fb5de6443086012e8c2a412ef768f2a9d Mon Sep 17 00:00:00 2001 From: Araozu Date: Mon, 17 Aug 2020 17:16:00 -0500 Subject: [PATCH] Arreglado error que impedia agregar cursos a mi horario --- src/components/Inicio/curso.vue | 5 +++-- src/store/index.js | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Inicio/curso.vue b/src/components/Inicio/curso.vue index f7f13b3..ee8c191 100644 --- a/src/components/Inicio/curso.vue +++ b/src/components/Inicio/curso.vue @@ -35,6 +35,7 @@ div.info_curso(:style="estiloCurso") | {{ cursoAgregado? "remove": "add" }} span.material-icons(@click.stop="ocultar_mostrarCursoV" :title="cursoOculto? 'Mostrar': 'Ocultar'") | {{ cursoOculto? 'visibility_off': 'visibility' }} + span {{ idCurso }} // @@ -99,8 +100,8 @@ div.info_curso(:style="estiloCurso") cursoAgregado = computed (=> cursosUsuario = store.state.horarioUsuario - for idCurso, _ of cursosUsuario - if idCurso is idCurso.value then return true + for idCursoC, _ of cursosUsuario + if idCursoC is idCurso.value then return true false ) diff --git a/src/store/index.js b/src/store/index.js index f488f56..522eab3 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -54,6 +54,8 @@ export default createStore({ while (ref.length > 0) ref.pop() }, agregarCursoAMiHorario(state, {nombre, datos}) { + console.log(nombre); + if (nombre === undefined) throw new Error("Error al agregar curso al horario. Nombre undefined."); if (!state.horarioUsuario[nombre]) { state.horarioUsuario[nombre] = datos; state.horarioUsuario = Object.assign({}, state.horarioUsuario);