diff --git a/src/services/NextAPI.js b/src/services/NextAPI.js index 56f03b7..405b89a 100644 --- a/src/services/NextAPI.js +++ b/src/services/NextAPI.js @@ -1,24 +1,26 @@ -import Axios from 'axios'; +import Axios from "axios"; function resolveEndpoint(env) { return ( + { - development: 'http://localhost:5000/v2', - staging: 'https://ufabc-matricula-test.cdd.naoseiprogramar.com.br/v1', - production: 'http://localhost:5000/v2', - }[env] || 'http://localhost:5000/v2' + development: "http://localhost:5000/v2", + staging: "https://ufabc-matricula-test.cdd.naoseiprogramar.com.br/v1", + production: "https://api.ufabcnext.com/v1", + }[env] || "http://localhost:8011/v1" + ); } function NextAPI() { - const baseURL = resolveEndpoint(process.env.NODE_ENV); + const baseURL = resolveEndpoint("development"); const REQUEST_TIMEOUT = 5000; const nextAPI = Axios.create({ baseURL, timeout: REQUEST_TIMEOUT, headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', + Accept: "application/json", + "Content-Type": "application/json", }, }); diff --git a/src/utils/sigaa/index.js b/src/utils/sigaa/index.js index 072e863..b88f790 100644 --- a/src/utils/sigaa/index.js +++ b/src/utils/sigaa/index.js @@ -74,11 +74,13 @@ function scrapeGradesConsulting() { studentDisciplinaHistory.push(disciplina); } } + const student = JSON.parse(localStorage.getItem('studentInfo')); const userHistory = { updateTime: updateDatetime, - curso: studentCourse.toLocaleLowerCase(), + course: studentCourse.toLocaleLowerCase(), ra: Number(ra), + courseKind: student.studentInfo.nivel, components: studentDisciplinaHistory, };