diff --git a/src/Store.ts b/src/Store.ts
index 542e7cc..15c91e0 100755
--- a/src/Store.ts
+++ b/src/Store.ts
@@ -29,7 +29,7 @@ export const horasDescanso = [
"15:40 - 15:50",
"17:30 - 17:40",
];
-export const SERVER_PATH = "";
+export const SERVER_PATH = "http://localhost:4000/sistema";
const numImgGuardado = Number(localStorage.getItem("num-img") ?? "0");
const tamanoLetraGuardado = Number(/* localStorage.getItem("tamano-letra") ?? */ "16");
diff --git a/src/Views/Index.tsx b/src/Views/Index.tsx
index 9b713cd..f5ea7ee 100644
--- a/src/Views/Index.tsx
+++ b/src/Views/Index.tsx
@@ -4,7 +4,7 @@ import { RouterLink } from "../Router";
import { batch, createSignal, Show } from "solid-js";
import { isMobile, setGruposSeleccionados } from "../Store";
import { MobileIndex } from "./MobileIndex";
-import { mockLoginEmpty, mockLoginNotEmpty, mockLoginWithError } from "../API/Login";
+import { loginFn } from "../API/Login";
const e = StyleSheet.create({
contenedorGlobal: {
@@ -46,17 +46,17 @@ const e = StyleSheet.create({
export function Index() {
const [msgErrorVisible, setMsgErrorVisible] = createSignal(false);
- const inputElement =
;
+ const inputElement =
;
const login = async(ev: Event) => {
ev.preventDefault();
const email = (inputElement as HTMLInputElement).value;
- const response = await mockLoginEmpty({correo_usuario: email});
+ const response = await loginFn({correo_usuario: email});
if (response === null) {
setMsgErrorVisible(true);
setTimeout(() => setMsgErrorVisible(false), 2500);
- } else if (response.matriculas.length === 0) {
+ } else if (!response.matriculas || response.matriculas.length === 0) {
localStorage.setItem("correo", email);
window.location.href = "#/pc/seleccion-cursos/";
} else if (response.matriculas.length > 0) {
@@ -73,9 +73,9 @@ export function Index() {
return (
<>
-
-
-
+
+
+
Horarios UNSA
-
+
Inicia sesión con tu correo institucional.
{inputElement}
@@ -92,17 +92,17 @@ export function Index() {
El correo es invalido
-
diff --git a/src/Views/MobileIndex.tsx b/src/Views/MobileIndex.tsx
index 88025aa..aa459ec 100644
--- a/src/Views/MobileIndex.tsx
+++ b/src/Views/MobileIndex.tsx
@@ -1,7 +1,7 @@
import { css, StyleSheet } from "aphrodite/no-important";
import { batch, createSignal } from "solid-js";
import { SERVER_PATH, setGruposSeleccionados } from "../Store";
-import { mockLoginEmpty } from "../API/Login";
+import { loginFn } from "../API/Login";
const e = StyleSheet.create({
contenedorGlobal: {
@@ -51,12 +51,12 @@ export function MobileIndex() {
});
const [msgErrorVisible, setMsgErrorVisible] = createSignal(false);
- const inputElement =
;
+ const inputElement =
;
const login = async(ev: Event) => {
ev.preventDefault();
const email = (inputElement as HTMLInputElement).value;
- const response = await mockLoginEmpty({correo_usuario: email});
+ const response = await loginFn({correo_usuario: email});
if (response === null) {
setMsgErrorVisible(true);
@@ -76,7 +76,7 @@ export function MobileIndex() {
};
return (
-
+
Iniciar sesión
@@ -84,7 +84,7 @@ export function MobileIndex() {
El correo es invalido
diff --git a/src/Views/SeleccionCursos.tsx b/src/Views/SeleccionCursos.tsx
index b1460d4..6e55fd3 100644
--- a/src/Views/SeleccionCursos.tsx
+++ b/src/Views/SeleccionCursos.tsx
@@ -2,7 +2,7 @@ import { TopBar } from "./SistemasMovil/TopBar";
import { StyleSheet, css } from "aphrodite/no-important";
import { Card } from "../components/Card";
import { createSignal, For } from "solid-js";
-import { getAllListaCursosMock, RespuestaListaCursos } from "../API/ListaCursos";
+import { getAllListaCursos, RespuestaListaCursos } from "../API/ListaCursos";
import { Button } from "../components/Button";
const s = StyleSheet.create({
@@ -23,7 +23,7 @@ export function SeleccionCursos() {
const [msjErr, setMsjError] = createSignal(false);
// Recuperar cursos de back
- (async() => setCursos(await getAllListaCursosMock()))();
+ (async() => setCursos(await getAllListaCursos()))();
const submit = (ev: Event) => {
ev.preventDefault();
@@ -62,14 +62,14 @@ export function SeleccionCursos() {
{([nombreAnio, infoCurso]) => (
{nombreAnio} año
-
+
{(curso) => (
<>
{curso.nombre_curso}
>
diff --git a/src/Views/SistemasMovil.tsx b/src/Views/SistemasMovil.tsx
index 28fad90..d153501 100644
--- a/src/Views/SistemasMovil.tsx
+++ b/src/Views/SistemasMovil.tsx
@@ -1,6 +1,6 @@
import { TopBar } from "./SistemasMovil/TopBar";
import { GrupoDia, Table, TableInput } from "./SistemasMovil/Table";
-import { getHorariosMock, Horario, ListaCursosCompleto } from "../API/CargaHorarios";
+import { getHorarios, Horario, ListaCursosCompleto } from "../API/CargaHorarios";
import { createSignal } from "solid-js";
import { generarMapaCeldas } from "./SistemasMovil/mapaCeldas";
import { Button } from "../components/Button";
@@ -12,7 +12,7 @@ export function SistemasMovil() {
// Obtener cursos seleccionados del servidor
(async() => {
const cursos: Array = JSON.parse(localStorage.getItem("cursos-seleccionados") ?? "[]");
- const data = await getHorariosMock({
+ const data = await getHorarios({
cursos: cursos.map((x) => parseInt(x, 10)),
});
setRawData(data);
diff --git a/src/Views/VerMatricula.tsx b/src/Views/VerMatricula.tsx
index fda5d06..d3cf54d 100644
--- a/src/Views/VerMatricula.tsx
+++ b/src/Views/VerMatricula.tsx
@@ -1,7 +1,7 @@
import { TopBar } from "./SistemasMovil/TopBar";
import { Card } from "../components/Card";
import { createSignal, For } from "solid-js";
-import { getMatriculaMock, InfoMatricula } from "../API/VerMatricula";
+import { getMatricula, InfoMatricula } from "../API/VerMatricula";
import { gruposSeleccionados } from "../Store";
export function VerMatricula() {
@@ -11,7 +11,7 @@ export function VerMatricula() {
const laboratorios = Object.entries(gruposSeleccionados)
.filter((x) => x[1] === true)
.map((x) => parseInt(x[0], 10));
- setInfoMatriculas(await getMatriculaMock({matriculas: laboratorios}));
+ setInfoMatriculas(await getMatricula({matriculas: laboratorios}));
})();
return (
diff --git a/src/Views/pc/SeleccionCursos.tsx b/src/Views/pc/SeleccionCursos.tsx
index 24946e0..20f1cf9 100644
--- a/src/Views/pc/SeleccionCursos.tsx
+++ b/src/Views/pc/SeleccionCursos.tsx
@@ -1,7 +1,7 @@
import { css, StyleSheet } from "aphrodite/no-important";
import { estilosGlobales } from "../../Estilos";
import { createSignal, For } from "solid-js";
-import { getAllListaCursosMock, RespuestaListaCursos } from "../../API/ListaCursos";
+import { getAllListaCursos, RespuestaListaCursos } from "../../API/ListaCursos";
const e = StyleSheet.create({
contenedorGlobal: {
@@ -55,7 +55,7 @@ export function SeleccionCursos() {
const [msgErr, setMsgError] = createSignal(false);
// Recuperar cursos de back
- (async() => setCursos(await getAllListaCursosMock()))();
+ (async() => setCursos(await getAllListaCursos()))();
const submit = (ev: Event) => {
ev.preventDefault();
@@ -83,10 +83,10 @@ export function SeleccionCursos() {
};
return (
-