Skip to content

Commit

Permalink
fix: buscarDados() em alunos/Home.tsx
Browse files Browse the repository at this point in the history
Corrigir a rota usada e também o objeto usado
  • Loading branch information
lucas0headshot committed Dec 12, 2024
1 parent 97e3b12 commit 22dc00a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/alunos/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ const Home = (): ReactElement => {
setCarregando(true);

try {
const resposta = await api.get<{ content: Aluno[] }>('/api/alunos/all');
setAlunos(resposta.data.content || []);
setAlunosFiltrados(resposta.data.content || []);
const resposta = await api.get<{ content: Aluno[] }>('/alunos/all');
setAlunos(resposta.data || []);
setAlunosFiltrados(resposta.data || []);
} catch (err) {
setErro(true);
console.error("Erro ao buscar alunos:", err);
Expand Down

0 comments on commit 22dc00a

Please sign in to comment.