Skip to content

Commit

Permalink
nova rota frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
yaskisoba committed Dec 13, 2023
1 parent 79f779b commit 2a92074
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Header = () => {
const handleLogout = async () => {
const accessToken = sessionStorage.getItem("accessToken");
try {
await axios.post("http://localhost:3001/auth/logout", { accessToken });
await axios.post("https://backend-matriculai.vercel.app/auth/logout", { accessToken });
sessionStorage.removeItem("accessToken");
navigate("/");
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/CreateEletivas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const CreateEletivas = () => {
schedules: parseInt(values.horario),
};

const response = await axios.post("http://localhost:3001/elective/createElective", data);
const response = await axios.post("https://backend-matriculai.vercel.app/elective/createElective", data);

if (response.status === 201) {
toast({
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/CreateTrilhas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const CreateTrilhas = () => {
values.eletivas.push("Projeto de Vida")
try {
const response = await axios.post(
"http://localhost:3001/learningpath/createLearningPaths",
"https://backend-matriculai.vercel.app/learningpath/createLearningPaths",
{
name: values.nomeTrilha,
description: values.descricao,
Expand Down Expand Up @@ -114,7 +114,7 @@ const CreateTrilhas = () => {
const fetchEletivas = async () => {
try {
const response = await axios.get(
"http://localhost:3001/elective/electives"
"https://backend-matriculai.vercel.app/elective/electives"
);
setEletivas(response.data);
} catch (error) {
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/ExclusionEletivas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const ExclusionEletivas = () => {
useEffect(() => {
async function fetchEletivas() {
try {
const response = await axios.get('http://localhost:3001/elective/electives'); // Endpoint para buscar trilhas
const response = await axios.get('https://backend-matriculai.vercel.app/elective/electives'); // Endpoint para buscar trilhas
setEletivas(response.data); // Define as trilhas na state 'trilhas'
} catch (error) {
console.error('Erro ao buscar trilhas:', error);
Expand All @@ -71,13 +71,13 @@ const ExclusionEletivas = () => {
try {
// Enviar uma solicitação para excluir as eletivas selecionadas
eletivasSelecionadas.map(async (eletiva) => {
await axios.delete('http://localhost:3001/elective/deleteElective', {
await axios.delete('https://backend-matriculai.vercel.app/elective/deleteElective', {
data: { id: eletiva },
});
})

// Atualizar a lista de eletivas após a exclusão
const response = await axios.get('http://localhost:3001/elective/electives');
const response = await axios.get('https://backend-matriculai.vercel.app/elective/electives');
setEletivas(response.data);

// Limpar a lista de eletivas selecionadas
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/ExclusionTrilhas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ExclusionTrilhas = () => {
useEffect(() => {
async function fetchTrilhas() {
try {
const response = await axios.get('http://localhost:3001/learningpath/learningpath'); // Endpoint para buscar trilhas
const response = await axios.get('https://backend-matriculai.vercel.app/learningpath/learningpath'); // Endpoint para buscar trilhas
setTrilhas(response.data); // Define as trilhas na state 'trilhas'
} catch (error) {
console.error('Erro ao buscar trilhas:', error);
Expand Down Expand Up @@ -72,13 +72,13 @@ const ExclusionTrilhas = () => {
try {
// Enviar uma solicitação para excluir as eletivas selecionadas
trilhasSelecionadas.map(async (eletiva) => {
await axios.delete('http://localhost:3001/learningpath/deleteLearningPaths', {
await axios.delete('https://backend-matriculai.vercel.app/learningpath/deleteLearningPaths', {
data: { id: eletiva },
});
})

// Atualizar a lista de eletivas após a exclusão
const response = await axios.get('http://localhost:3001/learningpath/learningpath');
const response = await axios.get('https://backend-matriculai.vercel.app/learningpath/learningpath');
setTrilhas(response.data);

// Limpar a lista de eletivas selecionadas
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/ListElectives/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ListElectives = () => {
useEffect(() => {
async function fetchEletivas() {
try {
const response = await axios.get('http://localhost:3001/elective/electives'); // Endpoint para buscar eletivas
const response = await axios.get('https://backend-matriculai.vercel.app/elective/electives'); // Endpoint para buscar eletivas
setEletivas(response.data);
} catch (error) {
console.error('Erro ao buscar eletivas:', error);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/ListLearningPath/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const ListLearningPath = () => {
useEffect(() => {
async function fetchTrilhas() {
try {
const response = await axios.get('http://localhost:3001/learningpath/learningpath'); // Endpoint para buscar trilhas
const response = await axios.get('https://backend-matriculai.vercel.app/learningpath/learningpath'); // Endpoint para buscar trilhas
setTrilhas(response.data); // Define as trilhas na state 'trilhas'
} catch (error) {
console.error('Erro ao buscar trilhas:', error);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/NewEnrolmentElectives/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const NewEnrolmentElectives = () => {
const fetchEletivas = async () => {
try {
const response = await axios.get(
"http://localhost:3001/elective/electives"
"https://backend-matriculai.vercel.app/elective/electives"
);
setEletivas(response.data);
} catch (error) {
Expand Down Expand Up @@ -74,7 +74,7 @@ const NewEnrolmentElectives = () => {
values.eletivas.push("Projeto de Vida")

try{
const response = await axios.post("http://localhost:3001/elective/matricula-eletivas",
const response = await axios.post("https://backend-matriculai.vercel.app/elective/matricula-eletivas",
{
names: JSON.stringify(values.eletivas),
student_id: parseInt(user),
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/NewEnrolmentLP/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const NewEnrolmentLP = () => {
useEffect(() => {
async function fetchTrilhas() {
try {
const response = await axios.get('http://localhost:3001/learningpath/learningpath'); // Endpoint para buscar trilhas
const response = await axios.get('https://backend-matriculai.vercel.app/learningpath/learningpath'); // Endpoint para buscar trilhas
setTrilhas(response.data); // Define as trilhas na state 'trilhas'
} catch (error) {
console.error('Erro ao buscar trilhas:', error);
Expand Down Expand Up @@ -64,7 +64,7 @@ const NewEnrolmentLP = () => {
navigate("/home-student");
}, 1000);
}else{
const response = await axios.post("http://localhost:3001/learningpathenrolment/studentenrolment",
const response = await axios.post("https://backend-matriculai.vercel.app/learningpathenrolment/studentenrolment",
{
student_id: parseInt(user),
learning_path_id: values.learning_path_id
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/pages/Recommendations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Recommendations = () => {
useEffect(() => {
async function fetchTrilhas() {
try {
const response = await axios.get('http://localhost:3001/learningpath/learningpath'); // Endpoint para buscar trilhas
const response = await axios.get('https://backend-matriculai.vercel.app/learningpath/learningpath'); // Endpoint para buscar trilhas
setTrilhas(response.data); // Define as trilhas na state 'trilhas'
} catch (error) {
console.error('Erro ao buscar trilhas:', error);
Expand Down Expand Up @@ -72,13 +72,13 @@ const Recommendations = () => {
try {
// Enviar uma solicitação para excluir as eletivas selecionadas
trilhasSelecionadas.map(async (eletiva) => {
await axios.delete('http://localhost:3001/learningpath/deleteLearningPaths', {
await axios.delete('https://backend-matriculai.vercel.app/learningpath/deleteLearningPaths', {
data: { id: eletiva },
});
})

// Atualizar a lista de eletivas após a exclusão
const response = await axios.get('http://localhost:3001/learningpath/learningpath');
const response = await axios.get('https://backend-matriculai.vercel.app/learningpath/learningpath');
setTrilhas(response.data);

// Limpar a lista de eletivas selecionadas
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/RegistrationPeriod/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const RegistrationPeriod = () => {
console.log(values);
try {
const response = await axios.post(
"http://localhost:3001/registration-period/create",
"https://backend-matriculai.vercel.app/registration-period/create",
{
start: values.startDate + " " + values.startTime,
end: values.endDate + " " + values.endTime,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/SendStudents/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const SendStudent = () => {
const formData = new FormData();
formData.append('arquivo', selectedFile);

axios.post('http://localhost:3001/send-file/extract-students', formData)
axios.post('https://backend-matriculai.vercel.app/send-file/extract-students', formData)
.then(response => {
console.log('Resposta do servidor:', response.data);
})
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Signin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Signin = () => {

const handleLogin = async () => {
try {
const response = await axios.post("http://localhost:3001/auth/login", {
const response = await axios.post("https://backend-matriculai.vercel.app/auth/login", {
email: email,
password: senha,
})
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/StudentsEl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const StudentsEl = () => {
useEffect(() => {
async function fetchEletiva() {
try {
const response = await axios.post('http://localhost:3001/elective/find-elective',
const response = await axios.post('https://backend-matriculai.vercel.app/elective/find-elective',
{
id: parseInt(eletivaId)
})
Expand All @@ -47,7 +47,7 @@ const StudentsEl = () => {
}
async function fetchStudents() {
try {
const response = await axios.post('http://localhost:3001/elective/students', {eletivaNome: eletiva.name});
const response = await axios.post('https://backend-matriculai.vercel.app/elective/students', {eletivaNome: eletiva.name});
setStudents(response.data);
console.log(response)
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/StudentsLP/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const StudentsLP = () => {
useEffect(() => {
async function fetchTrilha() {
try {
const response = await axios.post('http://localhost:3001/learningpath/find_lp', {
const response = await axios.post('https://backend-matriculai.vercel.app/learningpath/find_lp', {
id: parseInt(trilhaId)
})
setTrilha(response.data)
Expand All @@ -43,7 +43,7 @@ const StudentsLP = () => {
}
async function fetchStudents() {
try {
const response = await axios.post('http://localhost:3001/learningpathenrolment/students', {id: parseInt(trilhaId)});
const response = await axios.post('https://backend-matriculai.vercel.app/learningpathenrolment/students', {id: parseInt(trilhaId)});
setStudents(response.data);
console.log(response)
} catch (error) {
Expand Down

0 comments on commit 2a92074

Please sign in to comment.