diff --git a/frontend/src/components/Header/index.js b/frontend/src/components/Header/index.js index b167db76..fe051fa7 100644 --- a/frontend/src/components/Header/index.js +++ b/frontend/src/components/Header/index.js @@ -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) { diff --git a/frontend/src/pages/CreateEletivas/index.js b/frontend/src/pages/CreateEletivas/index.js index 61bfd4c9..4e01ae40 100644 --- a/frontend/src/pages/CreateEletivas/index.js +++ b/frontend/src/pages/CreateEletivas/index.js @@ -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({ diff --git a/frontend/src/pages/CreateTrilhas/index.js b/frontend/src/pages/CreateTrilhas/index.js index 77768d36..55b5bd36 100644 --- a/frontend/src/pages/CreateTrilhas/index.js +++ b/frontend/src/pages/CreateTrilhas/index.js @@ -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, @@ -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) { diff --git a/frontend/src/pages/ExclusionEletivas/index.js b/frontend/src/pages/ExclusionEletivas/index.js index 76817e25..215419be 100644 --- a/frontend/src/pages/ExclusionEletivas/index.js +++ b/frontend/src/pages/ExclusionEletivas/index.js @@ -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); @@ -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 diff --git a/frontend/src/pages/ExclusionTrilhas/index.js b/frontend/src/pages/ExclusionTrilhas/index.js index f6bc3147..9169cb52 100644 --- a/frontend/src/pages/ExclusionTrilhas/index.js +++ b/frontend/src/pages/ExclusionTrilhas/index.js @@ -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); @@ -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 diff --git a/frontend/src/pages/ListElectives/index.js b/frontend/src/pages/ListElectives/index.js index 5d15b58a..150aa6c1 100644 --- a/frontend/src/pages/ListElectives/index.js +++ b/frontend/src/pages/ListElectives/index.js @@ -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); diff --git a/frontend/src/pages/ListLearningPath/index.js b/frontend/src/pages/ListLearningPath/index.js index 579b4fd2..74edb7af 100644 --- a/frontend/src/pages/ListLearningPath/index.js +++ b/frontend/src/pages/ListLearningPath/index.js @@ -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); diff --git a/frontend/src/pages/NewEnrolmentElectives/index.js b/frontend/src/pages/NewEnrolmentElectives/index.js index 7dda12d2..74e3fb41 100644 --- a/frontend/src/pages/NewEnrolmentElectives/index.js +++ b/frontend/src/pages/NewEnrolmentElectives/index.js @@ -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) { @@ -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), diff --git a/frontend/src/pages/NewEnrolmentLP/index.js b/frontend/src/pages/NewEnrolmentLP/index.js index 7bd0666c..0a85ec14 100644 --- a/frontend/src/pages/NewEnrolmentLP/index.js +++ b/frontend/src/pages/NewEnrolmentLP/index.js @@ -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); @@ -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 diff --git a/frontend/src/pages/Recommendations/index.js b/frontend/src/pages/Recommendations/index.js index 87980007..7976791b 100644 --- a/frontend/src/pages/Recommendations/index.js +++ b/frontend/src/pages/Recommendations/index.js @@ -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); @@ -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 diff --git a/frontend/src/pages/RegistrationPeriod/index.js b/frontend/src/pages/RegistrationPeriod/index.js index c2727476..85ea37d8 100644 --- a/frontend/src/pages/RegistrationPeriod/index.js +++ b/frontend/src/pages/RegistrationPeriod/index.js @@ -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, diff --git a/frontend/src/pages/SendStudents/index.js b/frontend/src/pages/SendStudents/index.js index 81dd1782..c9ec2f07 100644 --- a/frontend/src/pages/SendStudents/index.js +++ b/frontend/src/pages/SendStudents/index.js @@ -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); }) diff --git a/frontend/src/pages/Signin/index.js b/frontend/src/pages/Signin/index.js index 3501a0ec..d2be8bfe 100644 --- a/frontend/src/pages/Signin/index.js +++ b/frontend/src/pages/Signin/index.js @@ -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, }) diff --git a/frontend/src/pages/StudentsEl/index.js b/frontend/src/pages/StudentsEl/index.js index e015532f..2dd274a2 100644 --- a/frontend/src/pages/StudentsEl/index.js +++ b/frontend/src/pages/StudentsEl/index.js @@ -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) }) @@ -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) { diff --git a/frontend/src/pages/StudentsLP/index.js b/frontend/src/pages/StudentsLP/index.js index e90924cf..4015f7b3 100644 --- a/frontend/src/pages/StudentsLP/index.js +++ b/frontend/src/pages/StudentsLP/index.js @@ -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) @@ -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) {