Skip to content

Commit

Permalink
wip: working on change attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
brMonteiro-G committed Aug 12, 2024
1 parent 3b9c8e9 commit ce8ca82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/services/NextAPI.js
Original file line number Diff line number Diff line change
@@ -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",
},
});

Expand Down
4 changes: 3 additions & 1 deletion src/utils/sigaa/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit ce8ca82

Please sign in to comment.